[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10650: view-mode inconsistencies wrt special mode-class

From: Juri Linkov
Subject: bug#10650: view-mode inconsistencies wrt special mode-class
Date: Thu, 02 Feb 2012 02:40:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (x86_64-pc-linux-gnu)

>> Personally I think a separate variable controlling which modes are
>> incompatible with view-mode would be better, but I'm not going to
>> complain if the definition of special modes is extended to cover this.
> I'm not sure exactly what's the idea with view-mode's use of special
> mode class, but IIUC it's that we don't want to enable view-mode in
> major modes that already have view-mode-like keybindings, which might
> boil down to something along the lines of "major modes which use
> suppress-keymap".

Without using the special mode class or adding a new separate variable,
the closest condition to match modes incompatible with view-mode would be:

  (and (buffer-file-name)
       (or (derived-mode-p 'special-mode)
           (equal (keymap-parent (current-local-map)) special-mode-map)))

What is worth to note is that these modes don't suppress the special-mode 
but inherit from it and override most of its key bindings.

But this heuristics is too unreliable, so explicitly declaring
incompatible modes is better.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]