GNU bug report logs - #70139
29.3.50; key-translate does not support all keyboard-translate usages

Previous Next

Package: emacs;

Reported by: Robert Pluim <rpluim <at> gmail.com>

Date: Tue, 2 Apr 2024 09:52:04 UTC

Severity: normal

Found in version 29.3.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 70139 <at> debbugs.gnu.org
Subject: bug#70139: 29.3.50; key-translate does not support all keyboard-translate usages
Date: Thu, 04 Apr 2024 15:27:39 +0300
> From: Robert Pluim <rpluim <at> gmail.com>
> Date: Tue, 02 Apr 2024 11:50:40 +0200
> 
> 
> When `key-translate' was added, it didnʼt cover all the cases that
> `keyboard-translate' does.
> 
> Add a translation:
> 
>     (keyboard-translate ?\C-a ?\C-z)
> 
> Two ways to remove, of which I submit the first is 'obvious':
> 
>     (keyboard-translate ?\C-a nil)
>     (keyboard-translate ?\C-a ?\C-a)
> 
> Add:
> 
>     (key-translate "C-a" "C-z")
> 
> This works for removing a translation but is non-obvious:
> 
>     (key-translate "C-a" "C-a")
> 
> But this doesnʼt:
> 
>     (key-translate "C-a" nil)
> 
> =>
> Debugger entered--Lisp error: (error "nil is not a valid key definition; see ‘key-valid-...")
>   signal(error ("nil is not a valid key definition; see ‘key-valid-..."))
>   error("%S is not a valid key definition; see `key-valid-p..." nil)
> 
> Iʼm not sure this is worth fixing, but perhaps documenting that
> re-adding the same translation is (almost) the same as removing it?

Stefan, any comments or suggestions?




This bug report was last modified 1 year and 54 days ago.

Previous Next


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