unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: repeat the last command n times
Date: Mon, 13 Mar 2006 13:11:37 -0800	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICAEKODDAA.drew.adams@oracle.com> (raw)
In-Reply-To: <1142171955.459973.111290@j33g2000cwa.googlegroups.com>

    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	other threads:[~2006-03-13 21:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-12 13:59 repeat the last command n times Florian Kaufmann
2006-03-13 21:11 ` Drew Adams [this message]
     [not found] ` <mailman.10.1142284306.30034.help-gnu-emacs@gnu.org>
2006-03-13 21:43   ` Johan Bockgård
2006-03-13 22:58   ` Florian Kaufmann
2006-03-17  4:36     ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DNEMKBNJBGPAOPIJOOICAEKODDAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).