emacs-devel
[Top][All Lists]
Advanced

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

Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature requ


From: Robert Pluim
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature request
Date: Sun, 24 Oct 2021 16:20:19 +0200

>>>>> On Sat, 23 Oct 2021 21:31:06 +0300, Juri Linkov <juri@linkov.net> said:

    >> Something like this for master? emacs-28 would be nice, but this is
    >> not a bugfix.
    >> 
    >> +            (princ (format-message " `%s' (bound to %s)\n" command
    >> +                                   (mapconcat
    >> +                                    (lambda (key)
    >> +                                      (format "'%s'" (key-description 
key)))
    >> + (where-is-internal command (symbol-value (car keymap)))
    >> +                                    " ,"))))

    Juri> Thanks, I tried this, but it shows global keybindings,
    Juri> not shorter repeatable keybindings from the repeat-map.
    Juri> For example,

    Juri>   ‘undo-repeat-map’ keymap is repeatable by these commands:
    Juri>    ‘undo’ (bound to 'u' ,'C-_' ,'<undo>' ,'C-/' ,'C-x u' ,'<menu-bar> 
<edit> <undo>')

    Juri> I expected that it will show only 'u' from ‘undo-repeat-map’.

Since somebody has liberally used 'defalias' in tab-bar.el, it becomes
this :-)

diff --git a/lisp/repeat.el b/lisp/repeat.el
index ac08952eaa..931615ed4c 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -516,7 +516,12 @@ describe-repeat-maps
           (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)

Note that this doesnʼt find the bindings for 'O' in
other-window-repeat-map nor 'M' in tab-bar-move-repeat map, because
the commands theyʼre bound to donʼt have the 'repeat-map' property,
which we might want to fix.

Juri> PS: the long lines could be refilled, but this is a minor problem.

The lines should be short enough with the above.

Robert
-- 



reply via email to

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