GNU bug report logs -
#73764
format-kbd-macro returns a key name that keymap-lookup doesn't recognize
Previous Next
Full log
Message #11 received at 73764 <at> debbugs.gnu.org (full text, mbox):
>> (keymap-lookup global-map "M-C-h")
>> ;;-> "M-C-h" is not a valid key definition; see `key-valid-p'
[...]
> Should we fix key-valid-p to be more lenient?
AFAIK the strictness was a conscious choice, so maybe we should simply
improve the error message to say something like "M-C-h uses an invalid
modifier ordering, maybe you meant C-M-h".
>> if we run this
>>
>> (format-kbd-macro (read-key-sequence-vector "Type C-M-h:"))
>>
>> we get "M-C-h".
I guess we also need to make sure `format-kbd-macro` generates
something that `key-valid-p` accepts.
> Or maybe just remove the call to keymap--check from keymap-lookup?
IIRC we wanted to use `keymap--check` on all input coming from the user,
so I guess the question is whether the second arg of `keymap-lookup` is
expected to be an immediate constant.
That function is still young, so it's hard to tell how it'll turn up,
but my `grep` says that indeed many (most) calls take a literal string
as argument, so `keymap--check` seems appropriate.
Stefan
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.