GNU bug report logs - #66792
30.0.50; describe-keymap shows unreachable parent map bindings

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Sat, 28 Oct 2023 13:36:01 UTC

Severity: normal

Tags: confirmed

Found in version 30.0.50

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Phil Sainty <psainty <at> orcon.net.nz>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 66792 <at> debbugs.gnu.org
Subject: Re: bug#66792: 30.0.50;
 describe-keymap shows unreachable parent map bindings
Date: Sat, 28 Oct 2023 16:56:04 +0300
> Date: Sun, 29 Oct 2023 02:34:41 +1300
> From: Phil Sainty <psainty <at> orcon.net.nz>
> 
> The following code demonstrates this bug involving parent keymaps:
> 
> ;; The parent keymap binds key sequence "a b"
> ;; (making "a" a prefix key with a submap).
> 
> (defvar my-keymap-parent
>    (let ((map (make-sparse-keymap)))
>      (define-key map (kbd "a b") 'foo)
>      map))
> 
> ;; The child keymap binds a command directly to "a" meaning
> ;; that the parent's submap is not accessible from the child.
> 
> (defvar my-keymap-child
>    (let ((map (make-sparse-keymap)))
>      (set-keymap-parent map my-keymap-parent)
>      (define-key map (kbd "a") 'bar)
>      map))
> 
> ;; However (describe-keymap 'my-keymap-child) displays the "a b"
> ;; binding as if it were a useable key sequence:
> 
> Key             Binding
> ------------------------
> a               bar
> 
> a b             foo
> 
> 
> I think that this output should only show the "a" binding.

Adding Stefan.




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

Previous Next


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