* bug#52448: key-valid-p vs "C-M-x" and "ESC C-x"
@ 2021-12-12 8:17 Stefan Kangas
2021-12-12 8:27 ` Lars Ingebrigtsen
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Kangas @ 2021-12-12 8:17 UTC (permalink / raw)
To: 52448
AFAIU, we want exactly one valid way to write keybindings with
`key-valid-p'. Should both of these be `key-valid-p'?
1. (key-description (kbd "ESC C-x"))
=> "C-M-x"
(key-valid-p "ESC C-x")
=> t
2. (key-description (kbd "C-M-x"))
=> "C-M-x"
(key-valid-p "C-M-x")
=> t
However, there is also this, and the comment at the top of keymap.c:
(kbd "ESC C-x")
=> "^[^X"
(kbd "M-C-x")
=> [134217752]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#52448: key-valid-p vs "C-M-x" and "ESC C-x"
2021-12-12 8:17 bug#52448: key-valid-p vs "C-M-x" and "ESC C-x" Stefan Kangas
@ 2021-12-12 8:27 ` Lars Ingebrigtsen
2021-12-13 13:33 ` Stefan Kangas
0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-12 8:27 UTC (permalink / raw)
To: Stefan Kangas; +Cc: 52448
Stefan Kangas <stefan@marxist.se> writes:
> AFAIU, we want exactly one valid way to write keybindings with
> `key-valid-p'. Should both of these be `key-valid-p'?
>
> 1. (key-description (kbd "ESC C-x"))
> => "C-M-x"
>
> (key-valid-p "ESC C-x")
> => t
That's what happens today, but Stefan M had a cunning plan to make
round-tripping these keystrokes (EST/TAB/RET) work better.
In that case
"ESC C-x"
and
"C-M-x"
would still both be valid, but refer to different things (that get
resolved to the same thing).
But we're not there today, so when writing keymaps one should use the
intended mnemonics. For instance, it's
"C-c C-i" #'gnus-info-find-node
and not
"C-c TAB" #'gnus-info-find-node
because the "i" is for "info".
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#52448: key-valid-p vs "C-M-x" and "ESC C-x"
2021-12-12 8:27 ` Lars Ingebrigtsen
@ 2021-12-13 13:33 ` Stefan Kangas
2021-12-13 23:18 ` Lars Ingebrigtsen
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Kangas @ 2021-12-13 13:33 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 52448
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Stefan Kangas <stefan@marxist.se> writes:
>
>> AFAIU, we want exactly one valid way to write keybindings with
>> `key-valid-p'. Should both of these be `key-valid-p'?
>>
>> 1. (key-description (kbd "ESC C-x"))
>> => "C-M-x"
>>
>> (key-valid-p "ESC C-x")
>> => t
>
> That's what happens today, but Stefan M had a cunning plan to make
> round-tripping these keystrokes (EST/TAB/RET) work better.
>
> In that case
>
> "ESC C-x"
>
> and
>
> "C-M-x"
>
> would still both be valid, but refer to different things (that get
> resolved to the same thing).
So both will be valid even with the planned changes, and this is
notabug?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-12-14 2:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-12 8:17 bug#52448: key-valid-p vs "C-M-x" and "ESC C-x" Stefan Kangas
2021-12-12 8:27 ` Lars Ingebrigtsen
2021-12-13 13:33 ` Stefan Kangas
2021-12-13 23:18 ` Lars Ingebrigtsen
2021-12-14 2:39 ` Stefan Kangas
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.