GNU bug report logs - #64417
30.0.50; keymap-unset :REMOVE keyword not working

Previous Next

Package: emacs;

Reported by: German Pacenza <germanp82 <at> hotmail.com>

Date: Sun, 2 Jul 2023 11:53:01 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: German Pacenza <germanp82 <at> hotmail.com>
Cc: 64417 <at> debbugs.gnu.org
Subject: Re: bug#64417: 30.0.50; keymap-unset :REMOVE keyword not working
Date: Sun, 02 Jul 2023 12:02:25 -0400
> When I evaluate:
> (keymap-unset diff-mode-map "M-SPC" :REMOVE)
> M-SPC still runs scroll-up-command
>
> (keymap-unset diff-mode-map "M-SPC")
> M-SPC is removed from diff-mode-map and cycle-spacing (global-mode-map)
> is activated
>
> This contradicts the keymap-unset docstring:
>
> If REMOVE, remove the binding instead of unsetting it.  This only
> makes a difference when there’s a parent keymap.  When unsetting
> a key in a child map, it will still shadow the same key in the
> parent keymap.  Removing the binding will allow the key in the
> parent keymap to be used.

Thanks for providing a great example of why the `remove` arg of
`keymap-unset` is a problematic feature :-)

The technical reason for the above: while `diff-mode-map` has no parent,
the keymap bound to ESC in `diff-mode-map` has `diff-mode-shared-map`
as parent, and `M-SPC` is the same (for keymap purposes) as `ESC SPC`.
Of curse, there's no binding of anything to `scroll-up-command` itself
in `diff-mode-shared-map` itself: the binding is to be found in
`diff-mode-shared-map`s parent, `special-mode-map`.

So we can't *remove* the binding from `M-SPC` to `scroll-up-command`
without modifying some other keymap.

So, the code is doing The Right Thing :-(


        Stefan





This bug report was last modified 1 year and 257 days ago.

Previous Next


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