Subject: bug#70820: [PATCH] Editable grep buffers

From: Jim Porter <[email-masked]>
Date: Wed, 8 May 2024 12:19:41 -0700

On 5/8/2024 11:42 AM, Eli Zaretskii wrote:
>> Date: Wed, 8 May 2024 10:37:42 -0700
>> Cc: [email-masked]
>> From: Jim Porter <[email-masked]>
>>
>> However, I agree with Visuwesh about not committing changes until the
>> end. For the grep case, you could have results in many, many files,
>> including (especially?) ones not open in Emacs yet.
> 
> I don't see why.  Grep shows all the matches in one file before it
> goes to the next.  So each time you edit the matches, you have just
> one file to care about, right?  Or what am I missing?

One of the ways I use wgrep is that I first search across my entire repo 
for some matching lines. Then, I activate wgrep and use query-replace to 
mass-change all those lines. (I use the "!" key with query-replace to 
tell it to change everything without prompting once I'm happy with my 
command.) This frequently involves me changing dozens of files at once 
even for relatively small projects.

Maybe there are better ways to perform this sort of action, but I find 
this method very useful because it shows me the steps along the way so 
that I can check my work before I commit to changing all those lines. I 
also don't have to manually step through each change once I'm happy with 
what I see.