GNU bug report logs - #65854
Multi-file replacement diff

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 10 Sep 2023 17:24:01 UTC

Severity: wishlist

Tags: patch

Fixed in version 30.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Eshel Yaron <me <at> eshelyaron.com>, 65854 <at> debbugs.gnu.org
Subject: bug#65854: Multi-file replacement diff
Date: Tue, 12 Sep 2023 09:52:42 +0300
>> Well, in the simple example of one file, yes that possible, but the
>> point is that you don't always know (or worry about) whether there's an
>> overlap between the files you have open and modified and the files your
>> regexp/wildcard matches.  Let's say I'm editing an HTML file, and find
>> something that I'd like to change.  So I do it.  Than I think "actually,
>> let's change that across all my HTML files in this directory".  IMO It
>> would be great if I could use this new command,
>> `multi-file-replace-regexp-as-diff`, to get a diff showing how that'd
>> look.  But in the proposed implementation, that won't work if one of
>> those HTML files is open and modified--without any warning, Emacs would
>> create a diff that doesn't apply.
>
> Our usual paradigm for these commands is to offer saving any buffers
> with unsaved edits, before running the main part of the command.

I don't know if users will find this too annoying, maybe not,
but probably this is what should be done to solve such dilemma that
the same diff can be used in two ways: by applying the diff to the
buffers with 'C-c C-a', or by applying to the files with 'git apply'.
Without saving the buffers before running the command, either
will fail: 'C-c C-a' will fail on changes produced from files,
'git apply' will fail on changes produced from unsaved buffers.




This bug report was last modified 1 year and 236 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.