[Top][All Lists]

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

Re: Doing search and replace via *grep* buffer

From: David Kastrup
Subject: Re: Doing search and replace via *grep* buffer
Date: Thu, 15 Feb 2007 20:39:54 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

"Lennart Borgman (gmail)" <address@hidden> writes:

> Kim F. Storm wrote:
>> "Lennart Borgman (gmail)" <address@hidden> writes:
>>> Looks very interesting, but would it not be possible to use a
>>> prompting similar for other replace commands in Emacs?
>> I don't follow...  Example, please.
> There are some replace entries in the menus, for example: Edit -
> Replace - Replace Regexp. That entry prompt first for a regexp to
> match (not applicable here) and then for the action to take. I meant
> something similar to the action prompt.
> And it would be nice with an entry there in the edit menu when you are
> in the grep buffer.

I find all of this far too contrived.  We don't need a bunch of new
keybindings and stuff.

Instead, if such functionality is desired, one can just make a minor
mode that will make C-x C-s save all changes in the grep buffer to the
respective files (for efficiency reasons, this might imply going
through the undo stack and getting the info about affected files and
lines, or after-modification-hook keeps track of the changes required
to the files in question).

That means that normal search and replace can be used on the buffer.
One just has to make sure that changes to file name and line number in
the buffer are flagged as an error (perhaps it is easiest to make them
read-only already when they are placed into the buffer).

David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

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