emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `global-set-key' vs `keymap-global-set' `key-valid-p' syntax


From: Emanuel Berg
Subject: Re: `global-set-key' vs `keymap-global-set' `key-valid-p' syntax
Date: Thu, 09 May 2024 17:24:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]