Here is a small patch which provides a very handy search and replace
functionality via the normal grep interfaces (including lgrep/rgrep).
It requires that grep regexp highlighting works (I suppose most modern
grep programs do that).
Here is an example of its use, replacing _some_ occurrences of
the identifier `oldtext' with `newtext':
First use rgrep to search for oldtext in all .c and .h files:
M-x rgrep RET oldtext RET ch RET RET
Then in the *grep* buffer, move to the first instance which you want to
replace (use `n' or C-n).
Then hit / and type the replacement text:
/ newtext RET
Now, still in the *grep* buffer, move to the next instance you want
to modify, and just hit . to repeat the replacement, for example:
n n . n . n . n n n .
(I suppose VI users will find this very familiar).