aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2025-01-14 21:48:53 +0200
committerJuri Linkov2025-01-14 21:48:53 +0200
commit2e937dc2b5ad7a87a099df3f014795e88df5cba9 (patch)
tree56ab173b9a872a096c1223457ccbbfb02fc2b652
parent0bd12f560b0b288e6c7717bf2e0f664c17d07619 (diff)
downloademacs-2e937dc2b5ad7a87a099df3f014795e88df5cba9.tar.gz
emacs-2e937dc2b5ad7a87a099df3f014795e88df5cba9.zip
Improve repeat-mode to correctly show multi-key sequences as echo
* 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'.
-rw-r--r--lisp/repeat.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/repeat.el b/lisp/repeat.el
index 7ff8a17aba4..fe8145e5daa 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -566,8 +566,9 @@ This function can be used to force exit of repetition while it's active."
566(defun repeat-echo-message-string (keymap) 566(defun repeat-echo-message-string (keymap)
567 "Return a string with the list of repeating keys in KEYMAP." 567 "Return a string with the list of repeating keys in KEYMAP."
568 (let (keys) 568 (let (keys)
569 (map-keymap (lambda (key cmd) (and cmd (push (cons key cmd) keys))) 569 (cl--map-keymap-recursively
570 keymap) 570 (lambda (key cmd) (and cmd (push (cons (copy-sequence key) cmd) keys)))
571 keymap)
571 (format-message 572 (format-message
572 "Repeat with %s%s" 573 "Repeat with %s%s"
573 (mapconcat (lambda (key-cmd) 574 (mapconcat (lambda (key-cmd)
@@ -577,7 +578,7 @@ This function can be used to force exit of repetition while it's active."
577 (get cmd 'repeat-hint)))) 578 (get cmd 'repeat-hint))))
578 ;; Reuse `read-multiple-choice' formatting. 579 ;; Reuse `read-multiple-choice' formatting.
579 (cdr (rmc--add-key-description (list key hint))) 580 (cdr (rmc--add-key-description (list key hint)))
580 (propertize (key-description (vector key)) 581 (propertize (key-description key)
581 'face 'read-multiple-choice-face)))) 582 'face 'read-multiple-choice-face))))
582 keys ", ") 583 keys ", ")
583 (if repeat-exit-key 584 (if repeat-exit-key