unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Juri Linkov <juri@linkov.net>
Cc: Ergus <spacibba@aol.com>, Drew Adams <drew.adams@oracle.com>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature request
Date: Sun, 24 Oct 2021 16:20:19 +0200	[thread overview]
Message-ID: <877de2zeqk.fsf@gmail.com> (raw)
In-Reply-To: <875ytn8ufp.fsf@mail.linkov.net> (Juri Linkov's message of "Sat,  23 Oct 2021 21:31:06 +0300")

>>>>> 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	other threads:[~2021-10-24 14:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87czs53aei.fsf.ref@aol.com>
     [not found] ` <87czs53aei.fsf@aol.com>
     [not found]   ` <87h7hh6o8t.fsf@mail.linkov.net>
     [not found]     ` <87wnqcv25h.fsf@mail.linkov.net>
     [not found]       ` <SA2PR10MB447476D46BE375158C054A77F3029@SA2PR10MB4474.namprd10.prod.outlook.com>
     [not found]         ` <874kdfekr8.fsf@gmail.com>
     [not found]           ` <87r1gj6say.fsf@mail.linkov.net>
     [not found]             ` <87r1cdz72i.fsf@gmail.com>
     [not found]               ` <875ytn8ufp.fsf@mail.linkov.net>
2021-10-24 14:20                 ` Robert Pluim [this message]
2021-10-24 19:12                   ` bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature request Juri Linkov
2021-10-24 20:02                     ` Robert Pluim
2021-10-25  7:41                       ` Juri Linkov
2021-10-25  8:55                         ` Robert Pluim
2021-10-25  9:21                           ` Stefan Kangas
2021-10-25  9:59                             ` Robert Pluim
2021-10-25 10:14                             ` Andreas Schwab
2021-10-25 17:54                               ` Juri Linkov
2021-10-25 18:08                                 ` Stefan Monnier
2021-10-25 19:59                                   ` Robert Pluim
2021-10-25 20:57                                     ` Stefan Monnier
2021-10-26 10:06                                       ` Robert Pluim
2021-10-26 10:25                                         ` Robert Pluim
2021-10-26 12:39                                         ` Stefan Monnier
2021-10-26 12:46                                           ` Robert Pluim
2021-10-25 17:58                           ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877de2zeqk.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=spacibba@aol.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).