Subject: bug#75993: Special mode-class for diff-mode

From: Stefan Monnier <[email-masked]>
Date: Sun, 02 Feb 2025 18:35:48 -0500

> Visiting a diff file and trying to copy lines with 'w' (diff-kill-ring-save)
> does something unexpected since view-mode overrides 'w' with
> 'View-scroll-page-backward-set-page-size' for non-nil 'view-read-only'.
>
> Here is the fix like for all modes that use single-letter keys:
[...]
> +(put 'diff-mode 'mode-class 'special)
>  ;;;###autoload
>  (define-derived-mode diff-mode fundamental-mode "Diff"
>    "Major mode for viewing/editing context diffs.

Hmm... this doesn't smell right:

- I hate distinguishing between "mode-class = special" and "derives from
  `special-mode`".
- Whether we want to do that depends on `diff-mode-read-only` which is
  buffer-local.

        Stefan