GNU bug report logs - #78714
30.1; failure binding keys to certain unicode characters

Previous Next

Package: emacs;

Reported by: John Holman <john.g.holman <at> gmail.com>

Date: Sat, 7 Jun 2025 11:48:01 UTC

Severity: normal

Tags: fixed

Found in version 30.1

Fixed in version 30.2

Done: Robert Pluim <rpluim <at> gmail.com>

Full log


View this message in rfc822 format

From: John Holman <john.g.holman <at> gmail.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 78714 <at> debbugs.gnu.org
Subject: bug#78714: 30.1; failure binding keys to certain unicode characters
Date: Mon, 9 Jun 2025 11:05:40 +0100
[Message part 1 (text/plain, inline)]
Many thanks Andreas - that's certainly more concise than using a lambda.

I do think this is a trap for users who may expect that a key definition
that a single character string simply specifies the character to be
inserted when that key is pressed rather than a macro. Treating a string
with a single character as a character to insert rather than a
one-character macro might avoid that, or if that is awkward to implement or
otherwise undesirable an explicit warning in the documentation might help.
The documentation for define-key does say that a string is treated as a
keyboard macro, but the significance of that is easy to miss.


On Sat, 7 Jun 2025 at 15:29, Andreas Schwab <schwab <at> linux-m68k.org> wrote:

> On Jun 07 2025, John Holman wrote:
>
> > 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
>
> Use vector notation instead: [?\u0082].  Generally, use of strings to
> represent key sequences should be avoided.
>
> --
> Andreas Schwab, schwab <at> linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
>
[Message part 2 (text/html, inline)]

This bug report was last modified 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.