Subject: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature request

From: Drew Adams <[email-masked]>
Date: Wed, 30 Jun 2021 15:10:24 +0000

>     >> > I thought the question was whether Emacs automatically,
>     >> > or already in some way, provides some a way of
>     >> > determining (e.g. using Lisp code) whether a given
>     >> > command is repeatable (i.e., by just holding down a key
>     >> > that it's bound to).
>     >> >
>     >> > If that's the question then I think the answer is no.
>     >> > (Is that right?)
>     >>
>     >> The request was to create a new command that lists all
>     >> repeatable commands and keymaps.
> 
>     Drew> Which amounts to the same thing: determining whether
>     Drew> a given command is repeatable.  I don't think Emacs has
>     Drew> a way of determining that.  (It would even seem to be
>     Drew> undecidable...)
> 
> (mapatoms (lambda (sym)
>             (and (commandp sym)
>                  (get sym 'repeat-map)
>                  (message "repeatable %s" sym))))
> 
> gets you the potentially repeatable commands. Whether theyʼre
> actually repeatable depends on whether 'repeat-mode' is active.

I see.  But `repeat-map' and the code supporting the code
you show are not in any Emacs release.  They're not even
in Emacs 28 code from earlier this year.  They're in the
repeat.el I just downloaded from Master - OK.

But it's possible to define repeatable commands that
don't use repeat.el at all.

I think my general statement stands, that it's impossible
for this check to be fully accurate/complete.  At the
very least, its doc should make clear that it makes sense
only (1) starting with Emacs 28 and (2) only for repeatable
commands defined using repeat.el code.

(Of course, for Emacs 28 we need not say it's only for
Emacs 28 or later.  But some communication of that fact
would help users.)

>   Drew> (Though I don't know what you might mean by "and keymaps".
>   Drew> Repeatable keymaps?)
> 
> Bindings to repeatable commands maybe?

Maybe; who knows?  A binding to a command is not a
keymap, and vice versa.  (A key can be bound to a
keymap, however.)