Function: repeat-echo-message-string

repeat-echo-message-string is a byte-compiled function defined in repeat.el.gz.

Signature

(repeat-echo-message-string KEYMAP)

Documentation

Return a string with the list of repeating keys in KEYMAP.

Source Code

;; Defined in /usr/src/emacs/lisp/repeat.el.gz
(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)
    (format-message
     "Repeat with %s%s"
     (mapconcat (lambda (key-cmd)
                  (let ((key (car key-cmd))
                        (cmd (cdr key-cmd)))
                    (if-let ((hint (and (symbolp cmd)
                                        (get cmd 'repeat-hint))))
                        ;; Reuse `read-multiple-choice' formatting.
                        (cdr (rmc--add-key-description (list key hint)))
                      (propertize (key-description (vector key))
                                  'face 'read-multiple-choice-face))))
                keys ", ")
     (if repeat-exit-key
         (substitute-command-keys
          (format ", or exit with \\`%s'"
                  (if (key-valid-p repeat-exit-key)
                      repeat-exit-key
                    (key-description repeat-exit-key))))
       ""))))