GNU bug report logs - #5062
23.1.50; image-toggle-display overwrites nxml-mode local key map

Previous Next

Package: emacs;

Reported by: Brent Goodrick <bgoodr <at> gmail.com>

Date: Sat, 28 Nov 2009 00:50:04 UTC

Severity: normal

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 5062 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Brent Goodrick <bgoodr <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 5062 <at> debbugs.gnu.org
Subject: Re: bug#5062: 23.1.50; image-toggle-display overwrites nxml-mode 
	local key map
Date: Sat, 28 Nov 2009 07:26:13 -0800
On Fri, Nov 27, 2009 at 6:25 PM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
>
> > 2. Run emacs -Q and wait for it to load and map into the display.
> > 3. Type C-x C-f /tmp/test.svg and see that the image of the file is
> > displayed.
> > 4. Type C-c C-c and note that the XML is shown. All correct behavior
> > so far.
> > 5. Type C-h k C-M-n and notice that the key for C-M-n is bound to
> > `forward-list' which is not correct because the .svg file is a xml
>
> Indeed, SVG files should be handled like postscript files, i.e. use
> image-minor-mode rather than image-mode.
> Can someone figure out how to to do that?

Hmmm, seems that image-minor-mode is enabled in this case, with a
major mode of nxml-mode.  But image-minor-mode ultimately calls
image-toggle-display, and image-toggle-display is calling
use-local-map to obliterate whatever map is already there.
image-minor-mode can also call use-local-map, too.  All of that
arrangement seems to be set up by the image-mode-maybe function.

I wonder what the correct "policy" is for a minor mode w.r.t.
keybindings that can shadow a major mode?  Should the major mode's
keymap be the top-most local keymap, with all minor modes as parent
maps of that top-most local keymap? Or is it the other way around,
with each minor mode "pushing" its own local mode map to be top-most,
and causing the current major modes local map to be that parent of
that new one that was "pushed"?

bg



This bug report was last modified 15 years and 150 days ago.

Previous Next


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