GNU bug report logs -
#70820
[PATCH] Editable grep buffers
Previous Next
Reported by: Visuwesh <visuweshm <at> gmail.com>
Date: Tue, 7 May 2024 16:26:01 UTC
Severity: normal
Tags: patch
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#70820: [PATCH] Editable grep buffers
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 70820 <at> debbugs.gnu.org.
--
70820: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70820
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> From: Visuwesh <visuweshm <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 70820 <at> debbugs.gnu.org
> Date: Mon, 09 Sep 2024 20:09:22 +0530
>
> [புதன் ஆகஸ்ட் 14, 2024] Visuwesh wrote:
>
> > [...]
> > If everyone is okay with the current patch, I can get to writing the
> > NEWS entry and updating the manual. Thanks.
>
> Sorry for the long delay. I've now attached a patch with such
> documentation changes.
Thanks, installed on the master branch, and closing the bug.
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
Tags: patch
Attached patch is a proof of concept for an occur-edit-mode alike for
*grep* buffers. It uses the new track-changes library to track the
edits made in the *grep* buffer to then finally save these edits to the
corresponding files. I've tested this with:
1. pure deletions: If you have a match that says "(cur-beg start"
and you change it to "(cur- start". This is special because
track-changes-fetch passes equal BEG and END to
grep-edit--track-changes-finalise.
2. edits: something like "(cur-beg start" -> "(cur-beg start balh"
is handled like you would expect.
3. edits with newline: if the edit includes a newline, then that is
reproduced.
and what is not handled currently: deleting a match line to imply
deletion of that line from the matched file. I don't know how to handle
this currently, I need to learn the library more.
There's also definitely a million more cases that I didn't anticipate
when I wrote the logic for grep-edit--track-changes-finalise.
I'm sending the patch now to see if there's enough interest before I go
about fixing the edge cases (there's bug#52815). If there is enough
interest, I will take a shot at implementing something like this for
xref result buffers too.
In GNU Emacs 30.0.50 (build 8, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.18.0, Xaw scroll bars) of 2024-05-07 built on astatine
Repository revision: 4b31074f5f49898ba0499a2b617cad425750eafa
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Debian GNU/Linux trixie/sid
Configured using:
'configure --with-sound=alsa --with-x-toolkit=lucid --with-json
--without-xaw3d --without-gconf --without-libsystemd --with-cairo
--with-xft'
[grep-edit.diff (text/patch, attachment)]
This bug report was last modified 305 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.