GNU bug report logs - #34723
27.0.50; customize and improve diff-mode recentering

Previous Next

Package: emacs;

Reported by: charles <at> aurox.ch

Date: Sun, 3 Mar 2019 20:33:01 UTC

Severity: minor

Found in version 27.0.50

Full log


View this message in rfc822 format

From: charles <at> aurox.ch (Charles A. Roelli)
To: 34723 <at> debbugs.gnu.org
Subject: bug#34723: 27.0.50; customize and improve diff-mode recentering 
Date: Sun, 03 Mar 2019 21:38:22 +0100
In Bug#32991 we touched on diff-mode conditionally recentering when
you use diff-hunk-next or diff-hunk-prev.  We found that this behavior
does not respect scroll-related variables (though Stefan suggested we
might be able to recenter while taking into account these variables).
It would be nice to allow disabling the behavior.

There are also cases where the diff-mode recentering ends up showing
less of the hunk than would have been displayed without the
recentering, which must be a bug.  In general, I don't understand why
recentering is thought to "show more" of a hunk in a buffer, when it
might show either less or more of a hunk in a buffer.

For example, if you look at the diff of commit 7523a9e in a
single-window GUI frame in master (emacs -Q), and type

M-: (set-frame-height (selected-frame) 15) RET
M-g c 450 RET
C-l C-l n

Emacs recenters and shows less of the hunk that you moved to.  This is
contrived, but is something you might come across a lot in small
windows, especially with longer hunks.

As a solution we could make C-M-l (reposition-window) work in
diff-mode and call that instead from diff-hunk-next and
diff-hunk-prev, with some customizable variable to enable or disable
the behavior.  Or fix the recentering code to stop recentering in
cases like the above.




This bug report was last modified 6 years and 87 days ago.

Previous Next


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