diff options
Diffstat (limited to 'lisp/repeat.el')
-rw-r--r-- | lisp/repeat.el | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/lisp/repeat.el b/lisp/repeat.el index 4d04f5ae951..fa65057a73f 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -176,7 +176,7 @@ that variable on the theory they're doing more good than harm; `repeat' does that, and usually does do more good than harm. However, like all do-gooders, sometimes `repeat' gets surprising results from its altruism. The value of this function is always whether the value of `this-command' would've been -'repeat if `repeat' hadn't modified it." +`repeat' if `repeat' hadn't modified it." (= repeat-num-input-keys-at-repeat num-input-keys)) ;; An example of the use of (repeat-is-really-this-command) may still be @@ -500,7 +500,7 @@ See `describe-repeat-maps' for a list of all repeatable commands." (defun repeat-echo-message-string (keymap) "Return a string with a list of repeating keys." (let (keys) - (map-keymap (lambda (key _) (push key keys)) keymap) + (map-keymap (lambda (key cmd) (and cmd (push key keys))) keymap) (format-message "Repeat with %s%s" (mapconcat (lambda (key) (key-description (vector key))) @@ -546,31 +546,35 @@ See `describe-repeat-maps' for a list of all repeatable commands." Used in `repeat-mode'." (interactive) (require 'help-fns) - (help-setup-xref (list #'describe-repeat-maps) - (called-interactively-p 'interactive)) - (let ((keymaps nil)) - (all-completions - "" obarray (lambda (s) - (and (commandp s) - (get s 'repeat-map) - (push s (alist-get (get s 'repeat-map) keymaps))))) - (with-help-window (help-buffer) - (with-current-buffer standard-output - (princ "A list of keymaps used by commands with the symbol property `repeat-map'.\n\n") - - (dolist (keymap (sort keymaps (lambda (a b) (string-lessp (car a) (car b))))) - (princ (format-message "`%s' keymap is repeatable by these commands:\n" - (car keymap))) - (dolist (command (sort (cdr keymap) 'string-lessp)) - (let* ((info (help-fns--analyze-function command)) - (map (list (symbol-value (car keymap)))) - (desc (mapconcat (lambda (key) - (format-message "`%s'" (key-description key))) - (or (where-is-internal command map) - (where-is-internal (nth 3 info) map)) - ", "))) - (princ (format-message " `%s' (bound to %s)\n" command desc)))) - (princ "\n")))))) + (let ((help-buffer-under-preparation t)) + (help-setup-xref (list #'describe-repeat-maps) + (called-interactively-p 'interactive)) + (let ((keymaps nil)) + (all-completions + "" obarray (lambda (s) + (and (commandp s) + (get s 'repeat-map) + (push s (alist-get (get s 'repeat-map) keymaps))))) + (with-help-window (help-buffer) + (with-current-buffer standard-output + (insert "A list of keymaps used by commands with the symbol property `repeat-map'.\n\n") + + (dolist (keymap (sort keymaps (lambda (a b) + (string-lessp (car a) (car b))))) + (insert (format-message + "`%s' keymap is repeatable by these commands:\n" + (car keymap))) + (dolist (command (sort (cdr keymap) #'string-lessp)) + (let* ((info (help-fns--analyze-function command)) + (map (list (symbol-value (car keymap)))) + (desc (mapconcat (lambda (key) + (propertize (key-description key) + 'face 'help-key-binding)) + (or (where-is-internal command map) + (where-is-internal (nth 3 info) map)) + ", "))) + (insert (format-message " `%s' (bound to %s)\n" command desc)))) + (insert "\n"))))))) (provide 'repeat) |