GNU bug report logs -
#73387
30.0.90; C-x v v in diff-mode doesn't work after C-c C-n
Previous Next
Reported by: Sean Whitton <spwhitton <at> spwhitton.name>
Date: Fri, 20 Sep 2024 16:10:01 UTC
Severity: normal
Found in version 30.0.90
Done: Sean Whitton <spwhitton <at> spwhitton.name>
Bug is archived. No further changes may be made.
Full log
Message #106 received at 73387 <at> debbugs.gnu.org (full text, mbox):
> From: Sean Whitton <spwhitton <at> spwhitton.name>
> Cc: dgutov <at> yandex.ru, 73387 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca,
> juri <at> linkov.net
> Date: Wed, 02 Oct 2024 09:26:42 +0800
>
> On Tue 01 Oct 2024 at 06:51pm +03, Eli Zaretskii wrote:
>
> > I can explain the rationale for doing the opposite: when describing
> > the operation with active region, we usually start with "If the region
> > is active..." or with some other similar conditional language. This
> > then makes it natural to explain the behavior in the other cases,
> > because the active-region one is clearly conditional, and thus not the
> > general case.
> >
> > By contrast, your text starts with the description of behavior that
> > has no conditions, and thus is perceived as the complete and
> > exhaustive. Then the next sentence is "out of the blue" because the
> > reader does not expect any such additions, being just told what the
> > command does, period.
>
> Yes, I know what you mean about that sentence coming out of the blue.
> But as Dmitry says, the behaviour when the region is active is a bonus
> feature, not really what the command is about.
>
> Do you think maybe this is better:
>
> Delete all hunks other than the current hunk.
> As a special case, when called interactively with an active region ...
This doesn't really address the issue, IMO.
The main problem I have here is with the "all" part of the first
sentence, which is then contradicted by the second. Also, in other
places, you describe the behavior when region is active, but not when
it isn't.
Here's what I would suggest to say in the manual:
@item C-c @key{RET} k
Delete diff hunks other than the current one. If the region is
active, this command deletes the hunks overlapped by the region;
otherwise it deletes all the hunks other than the current hunk. Do
@emph{not} invoke this command in a narrowed buffer, as that could
produce unexpected results.
And this is for the command's doc string:
(defun diff-delete-other-hunks (&optional beg end)
"Delete diff hunks other than the current one.
Interactively, if the region is active, delete all the hunks which
the region overlaps; otherwise delete all the hunks except the
current one.
When calling from Lisp, pass BEG and END as the bounds of region in
which to delete diff hunks; BEG and END omitted or nil means to
delete all the hunks but the one which contains point.
This bug report was last modified 232 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.