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

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

RE: repeat the last command n times


From: Drew Adams
Subject: RE: repeat the last command n times
Date: Mon, 13 Mar 2006 13:11:37 -0800

    I am searching for a command that repeats the last command n times. I
    know there is repeat, usually bound to C-x z. However, if y want to
    repeat the last command 12 times, I have to press z 12 times. Id rather
    liked to enter 12 directly.

Did you try this? M-x my-command C-u 12 C-x z

However, that doesn't seem to work for all commands. It works, for instance,
for character insertion, but not for `yank'.  For example, `a C-u 12 C-x z'
inserts 13 a's, but `C-y C-u 12 C-x z' does not perform 13 yanks.

I don't know if this inconsistency is a bug or a feature, but it is the same
going back to at least Emacs 20. The doc string doesn't help much in this
regard. It seems to indicate that the prefix arg should always be applied.

Here's the doc for `C-x z' (`repeat'):

 Repeat most recently executed command.
 With prefix arg, apply new prefix arg to that command; otherwise, use
 the prefix arg that was used before (if any).

 If this command is invoked by a multi-character key sequence, it can then
 be repeated by repeating the final character of that sequence.  This
behavior
 can be modified by the global variable `repeat-on-final-keystroke'."

Those who are familiar with what this command does or should do: Should the
doc string clarify the different cases where `C-u' does not have the
indicated effect?





reply via email to

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