Subject: Re: bug#78714: 30.1; failure binding keys to certain unicode characters

From: Eli Zaretskii <[email-masked]>
Date: Sat, 07 Jun 2025 15:05:55 +0300

> From: John Holman <[email-masked]>
> Date: Sat, 7 Jun 2025 12:46:56 +0100
> 
> Attempting to bind unicode characters (e.g. \u111E) to keys in a minor mode with syntax like
>   (define-key my-test-mode-map (kbd "c") "\u221E")
> usually works. In this case, C-h k c shows
> 
> c runs the command #<string CB7> (found in my-test-mode-map), which is
> a keyboard macro.
> It is bound to c.
> Macro: M-\20636
> Keyboard macro.
> 
> However the same syntax fails for some characters (so far I've noticed this for \u00B0 to \u00B6 but there
> will be more) e.g
> after (define-key my-test-mode-map (kbd "a") "\u00B2") C-h k shows
> 
> a runs the command #<string B6B> (found in my-test-mode-map), which is
> a keyboard macro.
> It is bound to a.
> Macro: M-2
> Keyboard macro.
> 
> and the effect of pressing "a" is to invoke command-digit-argument rather than insert the required character

It's a feature: #xB2 is #x32 with the high bit set, and the Meta bit
sets that bit.  See current-input-mode.