emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-28 fe2ac7c: * lisp/repeat.el (describe-repeat-maps): Use help-fns-


From: Juri Linkov
Subject: emacs-28 fe2ac7c: * lisp/repeat.el (describe-repeat-maps): Use help-fns--analyze-function.
Date: Mon, 15 Nov 2021 12:50:59 -0500 (EST)

branch: emacs-28
commit fe2ac7cb7cf206c86f80304906beb58302c0d31f
Author: Robert Pluim <rpluim@gmail.com>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/repeat.el (describe-repeat-maps): Use help-fns--analyze-function.
    
    Print keys bound to commands in every keymap (bug#49265)
---
 lisp/repeat.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/repeat.el b/lisp/repeat.el
index 4ad6019..96ea8a0 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]