GNU bug report logs -
#73407
31.0.50; Add diff-discard-hunk
Previous Next
Reported by: Sean Whitton <spwhitton <at> spwhitton.name>
Date: Sat, 21 Sep 2024 10:20:01 UTC
Severity: normal
Found in version 31.0.50
Done: Sean Whitton <spwhitton <at> spwhitton.name>
Bug is archived. No further changes may be made.
Full log
Message #44 received at 73407 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
On Tue 24 Sep 2024 at 03:21pm +03, Eli Zaretskii wrote:
> We should come up with a better name for this command.
> diff-discard-hunk tells me the command will discard the hunk, but says
> nothing about applying it, let alone reverse-applying it. How about
> diff-revert-hunk, or maybe diff-revert-and-discard?
Oh, nice. I was just following Magit, but including "revert" is better,
indeed. I think I prefer diff-revert-and-kill-hunk.
>> +This command is useful in buffers generated by @w{@kbd{C-x v =}} and
>> +@w{@kbd{C-x v D}} (@pxref{Old Revisions}). You can use this command to
>> +remove hunks you never intend to commit, such as temporary debug prints,
>> +and the like.
>
> This text could also use some clarification: "remove hunks you never
> intended to commit" only hints on what it actually does. A better
> description would be something like "undo some of the changes you made
> that you didn't intend". I wouldn't mention "commit" at all, since
> AFAIU this command is not specific to VC and doesn't require a VCS.
Yes, this is the diff-mode manual, so that makes sense.
I've made a similar change in the docstring but kept a reference to
committing, there.
>> - (message "%d hunks failed; no buffers changed" failures)))))
>> + (message "%d hunks failed; no buffers changed" failures)
>> + failures))))
>
> This comes from existing text, but still: what does the above say when
> there's only 1 failure? does it say "1 hunks failed"? If so, can we
> improve the handling of singular/plural here?
I've installed a fix for that.
On Tue 24 Sep 2024 at 03:22pm +03, Dmitry Gutov wrote:
> I'm a little concerned about the binding.
>
> We have 'diff-hunk-kill' on M-k (and also 'k'), and this new addition is
> actually more destructive. I'm expecting users will trip over the difference
> and call one of them when they wanted to call the other.
Yeah, and thinking about it more, it also doesn't really match what C-c
C-k does elsewhere in Emacs. I've made it C-c M-r in the attached v4.
--
Sean Whitton
[v4-0001-New-command-diff-revert-and-kill-hunk.patch (text/x-patch, attachment)]
This bug report was last modified 240 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.