GNU bug report logs - #73764
format-kbd-macro returns a key name that keymap-lookup doesn't recognize

Previous Next

Package: emacs;

Reported by: Eduardo Ochs <eduardoochs <at> gmail.com>

Date: Sat, 12 Oct 2024 04:47:02 UTC

Severity: normal

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Eduardo Ochs <eduardoochs <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 73764 <at> debbugs.gnu.org
Subject: Re: bug#73764: format-kbd-macro returns a key name that keymap-lookup
 doesn't recognize
Date: Sat, 12 Oct 2024 12:18:37 +0300
> From: Eduardo Ochs <eduardoochs <at> gmail.com>
> Date: Sat, 12 Oct 2024 01:46:26 -0300
> 
> if we run this
> 
>   (format-kbd-macro (read-key-sequence-vector "Type C-M-h:"))
> 
> we get "M-C-h". But try:
> 
>   (keymap-lookup global-map "M-C-h")
>     ;;-> "M-C-h" is not a valid key definition; see `key-valid-p'
> 
>   (keymap-lookup global-map "C-M-h")
>     ;;-> mark-defun

This is because key-valid-p is too restrictive: it only accepts
modifiers in the canonical order A-C-H-M-S-s.  But key-parse, which is
called by keymap-lookup, accepts and correctly processes the modifiers
in any order:

  (key-parse "M-C-h")
   => [134217736]

Should we fix key-valid-p to be more lenient?  Or maybe just remove
the call to keymap--check from keymap-look up?

Stefan, WDYT?




This bug report was last modified 340 days ago.

Previous Next


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