aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2021-06-29 23:36:16 +0300
committerJuri Linkov2021-06-29 23:36:16 +0300
commit94a2ef436b857d8b9909d8629190bd3fbb1be5d7 (patch)
tree4a469858e9cdef156a71ef177075d6a67461e785
parentcd339e85a695f40d93b5ce9f4e65075dd979b25b (diff)
downloademacs-94a2ef436b857d8b9909d8629190bd3fbb1be5d7.tar.gz
emacs-94a2ef436b857d8b9909d8629190bd3fbb1be5d7.zip
* lisp/repeat.el (describe-repeat): New command (bug#49265).
-rw-r--r--lisp/repeat.el24
1 files changed, 23 insertions, 1 deletions
diff --git a/lisp/repeat.el b/lisp/repeat.el
index 46c880d0dde..503cb340006 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -397,7 +397,7 @@ When Repeat mode is enabled, and the command symbol has the property named
397 (and (commandp s) 397 (and (commandp s)
398 (get s 'repeat-map) 398 (get s 'repeat-map)
399 (push (get s 'repeat-map) keymaps)))))) 399 (push (get s 'repeat-map) keymaps))))))
400 (message "Repeat mode is enabled for %d commands and %d keymaps" 400 (message "Repeat mode is enabled for %d commands and %d keymaps; see `describe-repeat'."
401 (length commands) 401 (length commands)
402 (length (delete-dups keymaps)))))) 402 (length (delete-dups keymaps))))))
403 403
@@ -489,6 +489,28 @@ When Repeat mode is enabled, and the command symbol has the property named
489 repeat-echo-mode-line-string))) 489 repeat-echo-mode-line-string)))
490 (force-mode-line-update t))) 490 (force-mode-line-update t)))
491 491
492(defun describe-repeat ()
493 "Describe repeatable commands and keymaps."
494 (interactive)
495 (help-setup-xref (list #'describe-repeat)
496 (called-interactively-p 'interactive))
497 (let ((keymaps nil))
498 (all-completions
499 "" obarray (lambda (s)
500 (and (commandp s)
501 (get s 'repeat-map)
502 (push s (alist-get (get s 'repeat-map) keymaps)))))
503 (with-help-window (help-buffer)
504 (with-current-buffer standard-output
505 (princ "This is a list of repeatable keymaps and commands.\n\n")
506
507 (dolist (keymap (sort keymaps (lambda (a b) (string-lessp (car a) (car b)))))
508 (princ (format-message "`%s' keymap is repeatable by these commands:\n"
509 (car keymap)))
510 (dolist (command (sort (cdr keymap) 'string-lessp))
511 (princ (format-message " `%s'\n" command)))
512 (princ "\n"))))))
513
492(provide 'repeat) 514(provide 'repeat)
493 515
494;;; repeat.el ends here 516;;; repeat.el ends here