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.