]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/repeat.el (describe-repeat-maps): Use help-fns--analyze-function.
authorRobert Pluim <rpluim@gmail.com>
Mon, 15 Nov 2021 17:50:30 +0000 (19:50 +0200)
committerJuri Linkov <juri@linkov.net>
Mon, 15 Nov 2021 17:50:30 +0000 (19:50 +0200)
Print keys bound to commands in every keymap (bug#49265)

lisp/repeat.el

index 4ad6019a04d97755637c1a641d990edd85a5a779..96ea8a0250103003c64b3ec9b4bb98a93d876a1d 100644 (file)
@@ -507,10 +507,13 @@ See `describe-repeat-maps' for a list of all repeatable commands."
                                             repeat-echo-mode-line-string)))
     (force-mode-line-update t)))
 
+(declare-function help-fns--analyze-function "help-fns" (function))
+
 (defun describe-repeat-maps ()
   "Describe mappings of commands repeatable by symbol property `repeat-map'.
 Used in `repeat-mode'."
   (interactive)
+  (require 'help-fns)
   (help-setup-xref (list #'describe-repeat-maps)
                    (called-interactively-p 'interactive))
   (let ((keymaps nil))
@@ -527,7 +530,12 @@ Used in `repeat-mode'."
           (princ (format-message "`%s' keymap is repeatable by these commands:\n"
                                  (car keymap)))
           (dolist (command (sort (cdr keymap) 'string-lessp))
-            (princ (format-message " `%s'\n" command)))
+            (let* ((info (help-fns--analyze-function command))
+                   (map (list (symbol-value (car keymap))))
+                   (desc (key-description
+                          (or (where-is-internal command map t)
+                              (where-is-internal (nth 3 info) map t)))))
+              (princ (format-message " `%s' (bound to '%s')\n" command desc))))
           (princ "\n"))))))
 
 (provide 'repeat)