GNU bug report logs -
#52448
key-valid-p vs "C-M-x" and "ESC C-x"
Previous Next
To reply to this bug, email your comments to 52448 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#52448
; Package
emacs
.
(Sun, 12 Dec 2021 08:18:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Kangas <stefan <at> marxist.se>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 12 Dec 2021 08:18:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#52448
; Package
emacs
.
(Sun, 12 Dec 2021 08:28:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 52448 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> 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
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#52448
; Package
emacs
.
(Mon, 13 Dec 2021 13:34:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 52448 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Stefan Kangas <stefan <at> 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?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#52448
; Package
emacs
.
(Mon, 13 Dec 2021 23:19:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 52448 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> marxist.se> writes:
> So both will be valid even with the planned changes, and this is
> notabug?
Yes, both will remain valid, but it's a bug that it's not round-tripping
properly, so the report might as well stay open until that's fixed.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#52448
; Package
emacs
.
(Tue, 14 Dec 2021 02:40:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 52448 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Yes, both will remain valid, but it's a bug that it's not round-tripping
> properly, so the report might as well stay open until that's fixed.
OK.
I'm linking the emacs-devel thread where round-tripping was discussed:
https://lists.gnu.org/archive/html/emacs-devel/2021-11/msg00941.html
This bug report was last modified 3 years and 90 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.