From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.bugs Subject: bug#34723: 27.0.50; customize and improve diff-mode recentering Date: Thu, 07 Mar 2019 20:49:54 +0100 Message-ID: References: <8336o1e33w.fsf@gnu.org> <83r2blcdj2.fsf@gnu.org> <83h8cgc7ih.fsf@gnu.org> Reply-To: charles@aurox.ch Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="160170"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34723@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 07 20:38: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 1h1yqO-000fXA-PV for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Mar 2019 20:38:16 +0100 Original-Received: from localhost ([127.0.0.1]:58333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1yqM-0002eF-IR for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Mar 2019 14:38:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1yqB-0002c4-Hh for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2019 14:38:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1yqA-0000rg-QL for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2019 14:38:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50319) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1yqA-0000rV-M9 for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2019 14:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h1yqA-0001Eg-Gz for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2019 14:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Mar 2019 19:38: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.15519874544714 (code B ref 34723); Thu, 07 Mar 2019 19:38:02 +0000 Original-Received: (at 34723) by debbugs.gnu.org; 7 Mar 2019 19:37:34 +0000 Original-Received: from localhost ([127.0.0.1]:35630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1ypi-0001Dy-9P for submit@debbugs.gnu.org; Thu, 07 Mar 2019 14:37:34 -0500 Original-Received: from nestroy.aurox.ch ([82.195.237.20]:41900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1ypg-0001Dl-KL for 34723@debbugs.gnu.org; Thu, 07 Mar 2019 14:37:33 -0500 Original-Received: from nestroy.aurox.ch (nestroy.aurox.ch [127.0.0.1]) by nestroy.aurox.ch (Postfix) with ESMTP id 44FgrQ0TLlznD4 for <34723@debbugs.gnu.org>; Thu, 7 Mar 2019 19:37:26 +0000 (UTC) Authentication-Results: nestroy.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:reply-to:subject:subject:in-reply-to:to:from:from :message-id:date:date; s=dkim2; t=1551987445; x=1554579446; bh=z eEI1kFtVLeLRStQBixyxhZyrvcDcMP1ehfTvwYGnu8=; b=KgnAev+kYB9Yzj8/o X/XBLCFGfX5zDbkcBdseHHxTNsQ44RUeFD9Al+pNElf2XZHV7TVArouvxsb1v1DN sqULryk4uITHzSn/u5qt6SLSCYzcIRa1oe87hraopuYN6nFYHqYDk8Fvm/Pj1gCb Qm1cFeg4DhO9saqe1aXp+Qo9OM= X-Virus-Scanned: Debian amavisd-new at nestroy.aurox.ch Original-Received: from nestroy.aurox.ch ([127.0.0.1]) by nestroy.aurox.ch (nestroy.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id SXZDairxemJI for <34723@debbugs.gnu.org>; Thu, 7 Mar 2019 19:37:25 +0000 (UTC) Original-Received: from gray (unknown [IPv6:2a02:1206:4512:5f50:c62c:3ff:fe30:b864]) by nestroy.aurox.ch (Postfix) with ESMTPSA id 44FgrP0z07znCx; Thu, 7 Mar 2019 19:37:25 +0000 (UTC) In-reply-to: <83h8cgc7ih.fsf@gnu.org> (message from Eli Zaretskii on Wed, 06 Mar 2019 18:06:14 +0200) 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:156128 Archived-At: > Date: Wed, 06 Mar 2019 18:06:14 +0200 > From: Eli Zaretskii > > Why does it call 'recenter'? It must have a reason, doesn't it? Does > the history of that code gives a clue? The doc of easy-mmode-define-navigation says: BASE-next also tries to make sure that the whole entry is visible by searching for its end (by calling ENDFUN if provided or by looking for the next entry) and recentering if necessary. There are cases where recentering does "make sure that the whole entry is visible", but as we saw in the first post of this report, there is at least one case where recentering makes less useful context visible. The current implementation seems a little too eager. I'd like to fix that, and at least allow to toggle the auto-recentering. > 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). Yes, I think you are right. Maybe diff-mode could have just set scroll-conservatively (or scroll-margin) in a buffer-local variable to get this auto-recentering behavior, although that would also step on user customizations.