[Top][All Lists]

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

RE: [PATCH] Make `C-x {' and `C-x }' repeatable

From: Drew Adams
Subject: RE: [PATCH] Make `C-x {' and `C-x }' repeatable
Date: Wed, 22 May 2013 16:53:43 -0700 (PDT)

> >> But it seems repeat.el can't be used if there are different commands
> >> in the key sequence.
> > No (i.e., correct), at least not the way I did it.
> Indeed.  But I don't think it's a big deal: set-temporary-overlay-map
> makes it easy enough that you shouldn't need to use repeat.el
> programatically (i.e. repeat.el is only useful as an implementation of
> the C-x z command).

Fine with me, if the things discussed (e.g., prefix arg passed to all
final-key "repetitions" after the prefix key) can be worked out.

I agree that, since it lets you define a group of related "repeatable"
final keys for the same prefix key, the `set-temporary-overlay-map'
approach is more general than what I do with `repeat-command'.  But it
is a little less convenient for the use case of a singleton group.

One good thing might be to have an abbreviation to handle that use case.
IOW, a simple way to do what one can do with `repeat-command', avoiding
explicitly creating a singleton keymap.  Not a big deal; it would be
just a little more convenient.

There is also the question (assuming a fix that would apply the prefix
arg from the prefix key to each repeated final key) of whether using a
prefix arg before an individual final key should affect only that key
occurrence or all subsequent key hits as well.

IOW, should using a prefix arg be modal for the repeated keys that follow it
(until/unless you use another prefix arg), or should it apply only to the
next final-key occurrence?

E.g., C-2 C-x a a a  C-6 a a a  C-3 a a

A prefix arg value of 2 should apply to each of the first 3 `a's (what
`repeat-command' does that Juri's approach currently does not do).

But should the prefix arg of 6 apply to just the first `a' that follows it,
with the next 2 `a's getting a prefix arg value of 2?  And likewise, the
prefix arg of 3 apply only to the `a' that immediately follows it?

Or should the prefix arg of 6 apply to the 3 `a's that follow it, and the
prefix arg of 3 apply to the last two `a's?  IOW, modal among final-key

reply via email to

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