GNU bug report logs - #10650
view-mode inconsistencies wrt special mode-class

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Mon, 30 Jan 2012 09:06:01 UTC

Severity: minor

Found in version 24.0.93

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #44 received at 10650 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Glenn Morris <rgm <at> gnu.org>, Chong Yidong <cyd <at> gnu.org>,
	10650 <at> debbugs.gnu.org
Subject: Re: bug#10650: view-mode inconsistencies wrt special mode-class
Date: Thu, 02 Feb 2012 02:40:45 +0200
>> 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 keymap,
but inherit from it and override most of its key bindings.

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




This bug report was last modified 13 years and 108 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.