Subject: Re: bug#77580: [PATCH] New command ediff-undo

From: Sean Whitton <[email-masked]>
Date: Tue, 08 Apr 2025 15:00:57 +0800

Hello,

On Tue 08 Apr 2025 at 07:25am +02, Paul D. Nelson wrote:

> As I see it, the advantages of "ediff-undo" are internal consistency
> with user-facing ediff-* commands, and brevity (for the command name,
> and buffer names like "*ediff-undo*").  The disadvantage is that it is
> not quite parallel to "diff-with-undo".  On the other hand, the two sets
> of commands are already not particularly consistent in their naming.

Yes, fine, ediff-undo and diff-with-undo it is.

> Let me know if you think this feature seems worth including.  I lean
> towards "no" out of a desire to keep the new commands consistent with
> "undo" itself, which does not accept a negative argument.

Yes, I think that we should leave this out.

>>> I hadn't thought about automatic detection along the lines that you
>>> suggest.  I think I'm happy to leave that for now, either to a
>>> refinement of this command or a future one.
>>
>> To be honest, I don't like adding a command where the normal way to use
>> it is to spam C-u.  The normal way to use it should be easy to access.
>> So let's try to think of something better.
>
> Agreed.
>
> Thinking further, this scenario seems niche rather than normal.  The
> original intent might be met more directly by some new command such as
> revert-buffer-in-region, diff-buffer-with-file-in-region,
> vc-diff-in-region, diff-backup-in-region, (...).
>
> The situation resembles that of the undo command itself.  Typically, we
> should either undo small amounts, or resort to one of the structural
> undo-like commands tied to file or VC status.  Only rarely should we
> need to do something like C-99 C-/ (possibly in a region), but that
> option remains a useful fallback.

So just to confirm, we both think that it would be good to come up with
a different command to satisfy the original use cases, because doing it
with ediff-undo and diff-with-undo requires spamming C-u, and that's
unergonomic?  (I ask because you posted an updated patch after writing
the above).

Of your suggestions here, my first thought is that maybe C-x x g could
start operating only on an active region, if there is one.  That seems
like a great new feature.

-- 
Sean Whitton