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

From: Stefan Monnier <[email-masked]>
Date: Mon, 03 Feb 2025 06:16:56 -0500

>> 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.
>
> AFAICS, the special mode-class is handled only in `read-only-mode`:
>
>    ((and buffer-read-only view-read-only
>          (not view-mode)
>          (not (eq (get major-mode 'mode-class) 'special)))
>     (view-mode-enter))
>
> This is exactly what is needed in diff-mode when it switches to read-only
> it should not enable view-mode.

Maybe, but:

- Nothing in its name or in its doc says so, AFAICT.  IOW, it's just an accident.
- As a symbol property, it's not buffer-local.

        Stefan