GNU bug report logs - #55842
29.0.50; Using shorthand syntax in keymap-global-set

Previous Next

Package: emacs;

Reported by: Arash Esbati <arash <at> gnu.org>

Date: Wed, 8 Jun 2022 09:49:02 UTC

Severity: normal

Tags: moreinfo

Found in version 29.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: arash <at> gnu.org, 55842 <at> debbugs.gnu.org
Subject: bug#55842: 29.0.50; Using shorthand syntax in keymap-global-set
Date: Thu, 09 Jun 2022 19:08:42 +0300
> Cc: 55842 <at> debbugs.gnu.org
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Thu, 09 Jun 2022 15:35:02 +0200
> 
> > 1. emacs -Q
> > 2. In scratch, eval (key-valid-p "C-TAB") => t
> > 3. In scratch, eval (keymap-global-set "C-TAB" #'other-window)
> > 4. Try 'C-h k Ctrl-Tab' => C-<tab> is undefined
> > 5. In scratch, eval (keymap-global-set "C-<tab>" #'other-window)
> > 6. 'C-h k Ctrl-Tab' returns the expected result.
> >
> > Am I missing something about shorthands?  Reading the docstring of
> > `key-valid-p', I thought the item 3. above should also work.
> 
> TAB is a complicated issue in Emacs, unfortunately.
> 
> "C-TAB" is just a different way to write "C-i", because TAB and C-i are
> the same in most terminals.
> 
> If you want to bind the C-<tab> key stroke, you have to specify it as
> such.  (And it won't work in most terminals, only in GUI Emacs.)
> 
> (key-valid-p "C-TAB") could signal an error to help lessen the
> confusion, I guess?  (And C-RET and C-LFD.)  Anybody got an opinion
> here?

Without thinking about this too much, my opinion is that if the new
APIs are to be the replacement for the obsolete ones, they had better
supported the same syntax, because I don't believe there's a single
Emacs user out there who doesn't have some key bindings in their init
files.  If the syntax is incompatible, how can we ever convince the
majority to switch?




This bug report was last modified 2 years and 344 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.