unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#69893: 29.2; Valid key "<TAB>" not accepted by `keymap-global-set'
@ 2024-03-18 21:14 tpeplt
  2024-03-21 12:36 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: tpeplt @ 2024-03-18 21:14 UTC (permalink / raw)
  To: 69893

Recipe for reproducing this problem:

1. Start Emacs at a shell prompt using "emacs -Q".

2. Evaluate the following expressions in the *scratch* buffer.

The following keys evaluate as valid (as expected):

(key-valid-p "TAB")
(key-valid-p "<TAB>")
(key-valid-p "<tab>")

The following key evaluates as invalid (as expected):

(key-valid-p "tab")

3. So, the following expressions should evaluate to
‘indent-for-tab-command’:

(keymap-global-set "<tab>" 'indent-for-tab-command)
(keymap-global-set "TAB" 'indent-for-tab-command)
(keymap-global-set "<TAB>" 'indent-for-tab-command)

The first two expressions evaluate as expected, but when the third
expression is evaluated, then the following message is reported:

keymap-global-set: To bind the key TAB, use [?\t], not [TAB]

Because (key-valid-p "<TAB>") evaluates to t, that error message appears
to be invalid.

4. Also, the following expressions all evaluate to nil:

(key-valid-p "[?\t]")
(key-valid-p "[?\\t]")

(key-valid-p "?\t")
(key-valid-p "?\\t")

(key-valid-p "<?\t>")
(key-valid-p "<?\\t>")

So the error message appears to direct a user to change the key string
to an invalid key.

--











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

end of thread, other threads:[~2024-03-21 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-18 21:14 bug#69893: 29.2; Valid key "<TAB>" not accepted by `keymap-global-set' tpeplt
2024-03-21 12:36 ` Eli Zaretskii
2024-03-21 19:46   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-21 20:13     ` Eli Zaretskii

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).