unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Philipp Haselwarter <philipp.haselwarter@gmx.de>
To: Jambunathan K <kjambunathan@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: copy and paste multiple times
Date: Wed, 25 Jan 2012 21:18:02 +0100	[thread overview]
Message-ID: <87ty3jy1s5.fsf@nzebook.haselwarter.org> (raw)
In-Reply-To: <81sjj3mz54.fsf@gmail.com> (Jambunathan K.'s message of "Wed, 25 Jan 2012 23:40:31 +0530")

On Wed, Jan 25 2012 19:10 (@1327515031), Jambunathan K wrote:

> Rajanikanth Jammalamadaka <rajanikanth@gmail.com> writes:
>
>> This has been discussed below:
>> http://stackoverflow.com/questions/71985/
>> emacs-equivalent-of-vims-yy10p 
>>
>> Is there no built-in (short :-)) command in emacs to copy and paste a
>> region multiple times?
>
> Use registers. Mark the region, store it in register `a' and insert the
> contents of register `a' multiple times.
>
> Mark region
>
> C-x r s a
>
> C-x r i a
> C-x r i a 

Combine it with `repeat':

C-x r s a
C-x r i a
C-x z a z a z a ...

Still, 9 + 2 * n keystrokes

Actually it would be a nice feature to make the behaviour of `repeat'
customizable, so that if `repeat-pass-argument' is t, numeric argument
would be passed to the command, and if nil it would simply repeat the
last command with its previous argument.

Then you could just set the default and create wrappers with let-binds
of `repeat-pass-argument'.

It would simplify the above considerably (and make it more intuitive, in
my opinion):

M-w C-y C-u n C-x z
6 + lg(n) keystrokes…

Any takers?

-- 
Philipp Haselwarter



      reply	other threads:[~2012-01-25 20:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-25 17:20 copy and paste multiple times Rajanikanth Jammalamadaka
2012-01-25 17:28 ` Andreas Röhler
2012-01-25 17:35 ` Teemu Likonen
2012-01-25 17:37   ` Rajanikanth Jammalamadaka
2012-01-25 17:52 ` Drew Adams
2012-01-25 18:10 ` Jambunathan K
2012-01-25 20:18   ` Philipp Haselwarter [this message]

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=87ty3jy1s5.fsf@nzebook.haselwarter.org \
    --to=philipp.haselwarter@gmx.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=kjambunathan@gmail.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).