unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: efficient replacing – really faster compared to using the mouse?
Date: Sun, 12 Aug 2012 10:49:55 +0800	[thread overview]
Message-ID: <87ipcokeng.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 86vcgpmv1b.fsf@w2139spb.ru.yotateam.com

On Sat, Aug 11 2012, Filipp Gunbin wrote:

>> What would be perfect in this particular case, would be a search-function that lets me edit the replacement-string after each occurrence.
>>
>> You would search for xyz, toggle through all the occurrences and for each occurrence you can type in an individual replacement string.
>>
>> (like M-% xyz ent 1 spc 1 spc 1 spc 2 spc 2 spc 2 spc 2 …..)
>>
>>
>> Is there something like this?
>
> That's exactly the thing I wrote about in
> http://lists.gnu.org/archive/html/help-gnu-emacs/2012-08/msg00149.html. Emacs
> saves the last replacement so you only have to change it at the
> beginning of the section.

One more (!) option, is to use a keyboard macro to do this. When
recording, delete the string you want to replace, then hit `C-u C-x q',
which will query you for the new string. `C-M-c' to tell it you're done.
Now every time you run the macro, it will stop at the same place and ask
you for a new string. I guess functionally no different from Filipp's
solution, but a good thing to know about.

See (emacs) Keyboard Macro Query

-- 
GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.11)
 of 2012-08-06 on pellet




  reply	other threads:[~2012-08-12  2:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.6706.1344612116.855.help-gnu-emacs@gnu.org>
2012-08-10 15:40 ` efficient replacing – really faster compared to using the mouse? Carson Chittom
2012-08-10 16:46 ` Raffaele Ricciardi
2012-08-10 16:47 ` Ralf Fassel
2012-08-10 18:44 ` B. T. Raven
2012-08-11  3:50 ` rusi
2012-08-11 11:55   ` Ferdinand
2012-08-11 13:13     ` Filipp Gunbin
2012-08-12  2:49       ` Eric Abrahamsen [this message]
2012-08-10 15:21 Ferdinand
2012-08-10 16:00 ` Filipp Gunbin
2012-08-10 16:46 ` Peter Dyballa
2012-08-10 18:14 ` Aurélien Aptel

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=87ipcokeng.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.org \
    /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).