]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve repeat-mode to correctly show multi-key sequences as echo
authorJuri Linkov <juri@linkov.net>
Tue, 14 Jan 2025 19:48:53 +0000 (21:48 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 17 Jan 2025 11:34:38 +0000 (12:34 +0100)
* lisp/repeat.el (repeat-echo-message-string):
Use 'cl--map-keymap-recursively' that iterates over
complete key sequences.  Also it returns key vectors,
so don't need to use 'vector'.

(cherry picked from commit 2e937dc2b5ad7a87a099df3f014795e88df5cba9)

lisp/repeat.el

index 2b062cf5b7af8f844515849820f3d0078d50384f..9d265f5035ada9cf4db12ecf7d3365ea665e2bb4 100644 (file)
@@ -568,8 +568,9 @@ This function can be used to force exit of repetition while it's active."
 (defun repeat-echo-message-string (keymap)
   "Return a string with the list of repeating keys in KEYMAP."
   (let (keys)
-    (map-keymap (lambda (key cmd) (and cmd (push (cons key cmd) keys)))
-                keymap)
+    (cl--map-keymap-recursively
+     (lambda (key cmd) (and cmd (push (cons (copy-sequence key) cmd) keys)))
+     keymap)
     (format-message
      "Repeat with %s%s"
      (mapconcat (lambda (key-cmd)
@@ -578,7 +579,7 @@ This function can be used to force exit of repetition while it's active."
                     (if-let ((hint (and (symbolp cmd)
                                         (get cmd 'repeat-hint))))
                         (rmc-key-description key hint)
-                      (propertize (key-description (vector key))
+                      (propertize (key-description key)
                                   'face 'read-multiple-choice))))
                 keys ", ")
      (if repeat-exit-key