unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* 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

* bug#52448: key-valid-p vs "C-M-x" and "ESC C-x"
  2021-12-13 13:33   ` Stefan Kangas
@ 2021-12-13 23:18     ` Lars Ingebrigtsen
  2021-12-14  2:39       ` Stefan Kangas
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-13 23:18 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 52448

Stefan Kangas <stefan@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#52448: key-valid-p vs "C-M-x" and "ESC C-x"
  2021-12-13 23:18     ` Lars Ingebrigtsen
@ 2021-12-14  2:39       ` Stefan Kangas
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Kangas @ 2021-12-14  2:39 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 52448

Lars Ingebrigtsen <larsi@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





^ 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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).