emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 93134bb9c2f: Make key-translate actually work


From: Robert Pluim
Subject: emacs-29 93134bb9c2f: Make key-translate actually work
Date: Mon, 18 Sep 2023 05:48:30 -0400 (EDT)

branch: emacs-29
commit 93134bb9c2f46b906b1b31b8fec264123d1962ee
Author: Shynur <one.last.kiss@outlook.com>
Commit: Robert Pluim <rpluim@gmail.com>

    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)
---
 lisp/keymap.el | 8 +++++---
 1 file 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]