GNU bug report logs -
#70139
29.3.50; key-translate does not support all keyboard-translate usages
Previous Next
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
[Message part 1 (text/plain, inline)]
On 4/2/24 12:50, Robert Pluim wrote:
> 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?
>
> Thanks
>
> Robert
>
> In GNU Emacs 29.3.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
> 3.24.38, cairo version 1.16.0) of 2024-04-02 built on rltb
> Repository revision: 6b8b0a12333afeadb32744ba481679b05b758ed2
> Repository branch: emacs-29
> Windowing system distributor 'The X.Org Foundation', version 11.0.12009000
> System Description: Debian GNU/Linux 12 (bookworm)
>
> Configured features:
> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
> JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
> INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
> TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
I accidentally sent the patch the wrong way (newcomer here), attaching here.
--
Charalampos Mitrodimas
[0001-Improve-key-translate-to-support-removing-translatio.patch (text/x-patch, attachment)]
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.