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: Juri Linkov
Subject: Re: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature request
Date: Sun, 24 Oct 2021 22:12:55 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>     >> 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 :-)

I fixed aliases for tab-bar.el some time ago, but was busy with fixing
other problems in repeat.el, so sorry for not pushing the fixes earlier.
Now I'll push them together with the unfinished test suite for repeat.el  :-)

> 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"))))))

Thanks, I tried this out, and everything looks nice.
I could push this in the next few days after trying to solve
remaining problems:

> 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.

Maybe it would be sufficient just to say that a key is bound to a lambda?

> Juri> PS: the long lines could be refilled, but this is a minor problem.
>
> The lines should be short enough with the above.

I agree, a long repeat-map is too unusual.



reply via email to

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