From: Shynur Date: Thu, 7 Sep 2023 07:58:59 +0000 (+0200) Subject: Make key-translate actually work X-Git-Tag: emacs-29.1.90~65 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=93134bb9c2f46b906b1b31b8fec264123d1962ee;p=emacs.git Make key-translate actually work * lisp/keymap.el (key-translate): Use the first element of the parsed keys rather than the whole vector. (Bug#65735) --- diff --git a/lisp/keymap.el b/lisp/keymap.el index 093536eda93..7e659c42002 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -382,15 +382,17 @@ which is This function creates a `keyboard-translate-table' if necessary and then modifies one entry in it. -Both KEY and TO should be specified by strings that satisfy `key-valid-p'." +Both FROM and TO should be specified by strings that satisfy `key-valid-p'." (declare (compiler-macro (lambda (form) (keymap--compile-check from to) form))) (keymap--check from) (keymap--check to) (or (char-table-p keyboard-translate-table) (setq keyboard-translate-table - (make-char-table 'keyboard-translate-table nil))) - (aset keyboard-translate-table (key-parse from) (key-parse to))) + (make-char-table 'keyboard-translate-table nil))) + (aset keyboard-translate-table + (aref (key-parse from) 0) + (aref (key-parse to) 0))) (defun keymap-lookup (keymap key &optional accept-default no-remap position) "Return the binding for command KEY in KEYMAP.