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)