bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Drew Adams
Subject: bug#49265: [External] : bug#49265: 28.0.50; repeat mode feature request
Date: Tue, 29 Jun 2021 15:25:42 +0000

> > Is it possible to add a command to get information about the commands
> > that have a repeat map? Basically something to know the commands with
> > some associated repeat like list-repeat-commands or describe-repeat or
> > so?
> 
> I thought that such a command could have the same prefix like 'repeat-help',
> but prefixes 'list-' and 'describe-' are also fine.  Maybe it should be
> similar to 'describe-bindings' or better 'describe-keymap'.

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?)
___

If the question is instead just whether there is some
naming convention for such repeatable commands, or if
it is just a suggestion to have such a convention, then
I'll offer the naming pattern I use for such commands:

I append `+' to the command name.

For example, I use `end-of-line+' as the name of my
repeatable version of `end-of-line'.

  If called interactively with no prefix arg:
     If the previous command was also `end-of-line+',
     then move to the end of the next line.  Else, move
     to the end of the current line.
  Otherwise, move to the end of the Nth next line (Nth
     previous line if N<0).  Command `end-of-line', by
     contrast, moves to the end of the (N-1)th next line.

Similarly, repeatable command `doremi-bg+' changes a
frame's background color incrementally.

IMO, it makes much more sense to use a suffix for a
"repeatable" indication than to use a prefix.  And
there's no need for a long (pre|suf)fix, such as
`repeat-'.

Emphasis should be on the actual command name, and not
on the fact that it's repeatable.  One char (or at most
`-' followed by a single char) should suffice.
___

The other part of the request is to have a command
that shows, describes, etc. only repeatable commands.
With my naming that trivially amounts to typing a
pattern that matches `+'.

Even if your completion method doesn't let you limit
matches to `+' only at the end of the name, you'll
likely get only repeatable commands, as there aren't
many existing commands with `+' in the name.

And of course it's easy to define a command that
matches only command names with `+' at the end.
And such a command could do anything you like with
the result (describe all matching commands, return
nil or non-nil for a given command-name arg,...).







reply via email to

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