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

From: Robert Pluim <[email-masked]>
Date: Tue, 10 Jun 2025 09:46:06 +0200

>>>>> On Mon, 9 Jun 2025 22:12:40 +0100, John Holman <[email-masked]> said:

    John> Hi Robert
    John> I just tried using key-description, for example

    John> (define-minor-mode math-typing-mode
    John>   "A minor mode for typing maths characters"
    John>   :init-value nil
    John>   :lighter " Math"
    John>   (let ((map (make-sparse-keymap)))
    John>     (if math-typing-mode
    John>      (progn

    John>         (define-key map (kbd "C-3") (key-description "\u00B3"))

    John>         (use-local-map map))
    John>       (use-local-map nil))))

    John> but this produces the same result as

    John> (define-key map (kbd "C-3") "\u00B3")

    John> while

    John> (define-key map (kbd "C-3") [?\u00B3]) or my original lambda works (inserts
    John> the unicode character when you press C-3)

    John> Probably I misunderstand what you are suggesting though?

No, Iʼd forgotten about one of the corner cases of
`key-description'. `key-parse' would work here, but that probably has
other issues, so specifying the vector is your best bet.

Robert
--