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 #32 received at 73387 <at> debbugs.gnu.org (full text, mbox):
Hello,
On Thu 26 Sep 2024 at 02:46am +03, Dmitry Gutov wrote:
> Suppose C-c C-n (or probably a different but similar binding) edited the diff
> instead of applying the narrowing, in a way that retained the file header(s),
> but keeping only the hunks intersecting the region or just the current one.
>
> Would that work for you just as well, or do you prefer to use narrowing
> anyway, for some other reasons?
It would work for me, and has a few advantages:
- it means you just hit 'g' afterwards, not C-x n w and then 'g'
- it fits better with our general paradigm of killing what you don't
want to include and then committing.
On the other hand, it doesn't seem ideal that after C-c C-n you can, for
example, use C-c C-a or C-c M-k, but not C-x v v. That could break you
out of your mental flow.
What do you think about this:
- add a command which does the kill-all-but-this-hunk (or hunks in
region if mark active) thing -- it's generally useful.
- make C-x v v on a narrowed buffer, by default, issue a message saying
"Cannot commit patch when narrowed, consider <binding of new command>"
- add a user option that when non-nil means C-x v v on a narrowed buffer
automatically widens, invokes the new command, and then commits.
My thinking is that the latter behaviour is complex and so shouldn't be
the default, but once you understand what's going on then there is a
good chance you want to enable it.
--
Sean Whitton
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.