From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34723: 27.0.50; customize and improve diff-mode recentering Date: Wed, 06 Mar 2019 18:06:14 +0200 Message-ID: <83h8cgc7ih.fsf@gnu.org> References: <8336o1e33w.fsf@gnu.org> <83r2blcdj2.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="253817"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34723@debbugs.gnu.org To: charles@aurox.ch Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 06 17:07:19 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1Z4g-0013uw-NI for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Mar 2019 17:07:18 +0100 Original-Received: from localhost ([127.0.0.1]:35462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Z4f-0003V4-Jh for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Mar 2019 11:07:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Z4U-0003TK-9O for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 11:07:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1Z4R-0000WL-Kx for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 11:07:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49305) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1Z4Q-0000VT-Cm for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 11:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h1Z4Q-0002RR-5h for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 11:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Mar 2019 16:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34723 X-GNU-PR-Package: emacs Original-Received: via spool by 34723-submit@debbugs.gnu.org id=B34723.15518884009345 (code B ref 34723); Wed, 06 Mar 2019 16:07:02 +0000 Original-Received: (at 34723) by debbugs.gnu.org; 6 Mar 2019 16:06:40 +0000 Original-Received: from localhost ([127.0.0.1]:34613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1Z42-0002Qd-JH for submit@debbugs.gnu.org; Wed, 06 Mar 2019 11:06:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1Z3z-0002QP-SM for 34723@debbugs.gnu.org; Wed, 06 Mar 2019 11:06:36 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Z3m-0008Tc-Lq; Wed, 06 Mar 2019 11:06:25 -0500 Original-Received: from [176.228.60.248] (port=3823 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h1Z3d-0002jA-CZ; Wed, 06 Mar 2019 11:06:16 -0500 In-reply-to: (charles@aurox.ch) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156101 Archived-At: > Date: Tue, 05 Mar 2019 21:37:32 +0100 > From: charles@aurox.ch (Charles A. Roelli) > CC: 34723@debbugs.gnu.org > > > I don't understand what calling 'recenter' has to do with > > scroll-conservatively. And scroll-conservatively is implemented in > > the display engine, so I'm afraid I'm still in the dark regarding the > > nature of the problem you are discussing. > > Does the following scenario make some sense? diff-hunk-next moves > point to a position beyond (window-end), and immediately calls > (recenter '(0)). Scrolling (which would otherwise respect > scroll-conservatively) gets preempted by diff-hunk-next's call to > recenter. Why does it call 'recenter'? It must have a reason, doesn't it? Does the history of that code gives a clue? Note that without recentering, if you just move point to some location in the diffs, when scroll-conservatively > 100, point will wind up either on the last screen line of the window or its first screen line, depending on whether you move forward or back in the buffer. The latter might be okay, but the former will most probably hide most of the hunk, which might be the reason for recentering (I'm just guessing here).