all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: emacs-devel@gnu.org
Subject: Re: `global-set-key' vs `keymap-global-set' `key-valid-p' syntax
Date: Thu, 09 May 2024 17:24:14 +0200	[thread overview]
Message-ID: <8734qrnh41.fsf@dataswamp.org> (raw)
In-Reply-To: 87r0eb6zr3.fsf@dataswamp.org

Warning, don't set "C-[" as a key or use it as a definition,
that breaks M-x as C-[, or ^[, is also ESC.

$ ascii '^['
ASCII 1/11 is decimal 027, hex 1b, octal 033, bits 00011011: called ^[, ESC
Official name: Escape

Yes, making a new (?) definition with the same name also does
not help. You can however rewire the terminal emulator to
insert another char on that keystroke and then give that key
another definition name, e.g. like this for the character
inserted being 1005 in hex:

(keymap-set input-decode-map (char-to-string ?\u1005) "C-<left-square-bracket>")

For some reason tho, this logic does not seem to apply to C-;
or ^;, which is also 027:

ascii '^;'
ASCII 1/11 is decimal 027, hex 1b, octal 033, bits 00011011: called ^[, ESC
Official name: Escape

It can be set and used in a definition with that name, "C-;",
I have no idea why but I guess just to be safe/consistent one
can call it "C-<semicolon>".

Using de facto key notation on a US QWERTY, C-[ is somewhat
ergonomic, whereas C-; is really nice! So recommended.

-- 
underground experts united
https://dataswamp.org/~incal




      reply	other threads:[~2024-05-09 15:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07  6:19 `global-set-key' vs `keymap-global-set' `key-valid-p' syntax Emanuel Berg
2024-05-07 11:15 ` Emanuel Berg
2024-05-07 13:43   ` Emanuel Berg
2024-05-07 13:47   ` Emanuel Berg
2024-05-07 14:42     ` Andreas Schwab
2024-05-09 10:06       ` Emanuel Berg
2024-05-09 10:33       ` Emanuel Berg
2024-05-09 15:24         ` Emanuel Berg [this message]

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

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

  git send-email \
    --in-reply-to=8734qrnh41.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=emacs-devel@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.