]> git.eshelyaron.com Git - emacs.git/commit
Improve 'key-translate' to support removing translations
authorCharalampos Mitrodimas <charmitro@posteo.net>
Tue, 2 Apr 2024 19:02:46 +0000 (19:02 +0000)
committerEshel Yaron <me@eshelyaron.com>
Thu, 23 May 2024 20:36:32 +0000 (22:36 +0200)
commita04f73de743a0b4c589963b052f9b242f5df8ecd
tree20d61c339431d869f4b5e1b074f44bbcb9f1d2dc
parentbe8b9bf41c67ce0f4f18f540db026b97289b3786
Improve 'key-translate' to support removing translations

This patch enhances the key-translate function to allow removing
keyboard translations by passing nil as the second argument (TO).
If TO is nil, any existing translation for the FROM key will be
removed.  The compiler macro is updated to only check TO when it
is non-nil.  This change makes key-translate more consistent with
the behavior of 'keyboard-translate', providing a way to remove
translations without having to specify the same key for both FROM
and TO.
The documentation string is updated to reflect the new behavior.

* lisp/keymap.el (key-translate): Support removing translations
by passing nil as the second argument (TO).  Also signal an error
if multiple items are passed.  (Bug#70139)

(cherry picked from commit 8f010e9a2926bd3886c54a0360ff341bc66f8088)
lisp/keymap.el