unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Arash Esbati <arash@gnu.org>
Cc: 55842@debbugs.gnu.org
Subject: bug#55842: 29.0.50; Using shorthand syntax in keymap-global-set
Date: Thu, 09 Jun 2022 15:35:02 +0200	[thread overview]
Message-ID: <874k0u55a1.fsf@gnus.org> (raw)
In-Reply-To: <86czfjlc4r.fsf@gnu.org> (Arash Esbati's message of "Wed, 08 Jun 2022 11:48:04 +0200")

Arash Esbati <arash@gnu.org> writes:

> I tried to switch from `global-set-key' to `keymap-global-set' and this
> is my first observation: I can't use shorthand syntax.  To reproduce:
>
> 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?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2022-06-09 13:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08  9:48 bug#55842: 29.0.50; Using shorthand syntax in keymap-global-set Arash Esbati
2022-06-09 13:35 ` Lars Ingebrigtsen [this message]
2022-06-09 16:08   ` Eli Zaretskii
2022-06-09 16:37     ` Lars Ingebrigtsen
2022-06-09 16:43       ` Lars Ingebrigtsen
2022-06-09 16:55       ` Eli Zaretskii
2022-06-09 17:14         ` Lars Ingebrigtsen
2022-06-09 17:49           ` Eli Zaretskii
2022-06-10 22:46             ` Richard Stallman
2022-06-10  8:32   ` Arash Esbati
2022-06-10  8:57     ` Lars Ingebrigtsen
2022-06-10 10:33       ` Arash Esbati

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874k0u55a1.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=55842@debbugs.gnu.org \
    --cc=arash@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).