diff options
author | Shynur <one.last.kiss@outlook.com> | 2023-09-07 09:58:59 +0200 |
---|---|---|
committer | Robert Pluim <rpluim@gmail.com> | 2023-09-18 10:19:49 +0200 |
commit | 93134bb9c2f46b906b1b31b8fec264123d1962ee (patch) | |
tree | d6b1b4989fbabb338b62c934393c415093d80122 /lisp | |
parent | 85f49a9bc8b9bf699a692787820efc0f8aa67545 (diff) | |
download | emacs-93134bb9c2f46b906b1b31b8fec264123d1962ee.tar.gz |
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)
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/keymap.el | 8 |
1 files changed, 5 insertions, 3 deletions
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. |