(defvar-keymap expreg-repeat-map
:doc "Repeat map for `expreg' actions."
:repeat t
:name "expreg"
"\\" (cons "expand" 'expreg-expand)
"|" (cons "contract" 'expreg-contract))
Repeat with \:expand, |:contract
--- repeat_old.el 2024-04-25 18:22:59
+++ repeat.el 2024-04-25 18:09:11
@@ -553,12 +553,20 @@
(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 key keys))) keymap)
+ (map-keymap (lambda (key cmd)
+ (if (consp cmd)
+ (push (cons (car cmd) key) keys)
+ (when cmd (push key keys))))
+ keymap)
(format-message "Repeat with %s%s"
(mapconcat (lambda (key)
- (substitute-command-keys
- (format "\\`%s'"
- (key-description (vector key)))))
+ (let* ((cmd (when (consp key) (format ":%s" (car key)))))
+ (if (consp key) (setq key (cdr key)))
+ (concat
+ (substitute-command-keys
+ (format "\\`%s'"
+ (key-description (vector key))))
+ cmd)))
keys ", ")
(if repeat-exit-key
(substitute-command-keys