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

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

Re: efficient replacing – really faster compared to using the mouse?


From: Eric Abrahamsen
Subject: Re: efficient replacing – really faster compared to using the mouse?
Date: Sun, 12 Aug 2012 10:49:55 +0800
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux)

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 via email to

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