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: Sun, 03 Mar 2019 21:38:22 +0100 Message-ID: Reply-To: charles@aurox.ch Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="132722"; mail-complaints-to="usenet@blaine.gmane.org" To: 34723@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 03 21:33:14 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 1h0XnN-000YOH-BK for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Mar 2019 21:33:13 +0100 Original-Received: from localhost ([127.0.0.1]:43863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0XnM-0003yL-2n for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Mar 2019 15:33:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0XnD-0003wY-84 for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2019 15:33:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0XnC-0003v0-D9 for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2019 15:33:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45173) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h0XnC-0003un-9F for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2019 15:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h0XnB-00022q-Ud for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2019 15:33:01 -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: Sun, 03 Mar 2019 20:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34723 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15516451307797 (code B ref -1); Sun, 03 Mar 2019 20:33:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Mar 2019 20:32:10 +0000 Original-Received: from localhost ([127.0.0.1]:58717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0XmM-00021h-DE for submit@debbugs.gnu.org; Sun, 03 Mar 2019 15:32:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0XmK-00021T-CJ for submit@debbugs.gnu.org; Sun, 03 Mar 2019 15:32:09 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:41531) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0XmF-0002Ah-4J for submit@debbugs.gnu.org; Sun, 03 Mar 2019 15:32:03 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0XmE-0003Sc-79 for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2019 15:32:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0XmD-00029a-DZ for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2019 15:32:02 -0500 Original-Received: from nestroy.aurox.ch ([82.195.237.20]:53860) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0XmC-0001nR-Q7 for bug-gnu-emacs@gnu.org; Sun, 03 Mar 2019 15:32:01 -0500 Original-Received: from nestroy.aurox.ch (nestroy.aurox.ch [127.0.0.1]) by nestroy.aurox.ch (Postfix) with ESMTP id 44CF6m5mbtzkfV for ; Sun, 3 Mar 2019 20:26:24 +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= reply-to:subject:subject:to:from:from:message-id:date:date; s= dkim2; t=1551644784; x=1554236785; bh=KFa8CTVFfJVNPJfwAjE2J6K9EU m/uDDVQ7cgOSRQl1k=; b=DaNsjQeWLJHz88lA/TE8NLYmV5pN4rQlA0mguNKKlP iekrauaKTO5iSp8aEMRrRXBVhagcLhn2fDVmJG5HaDBJKPrkOuIJEQDi3DmTSeaq /B/u4eW9959uK+XCRvJb0UHHkS0+iDJOvQRs3lrXEuLo/hx6ZojJcU39LMNMk716 0= 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 RBcZOlRwkVvq for ; Sun, 3 Mar 2019 20:26:24 +0000 (UTC) Original-Received: from gray (unknown [IPv6:2a02:1206:4512:5f50:c62c:3ff:fe30:b864]) by nestroy.aurox.ch (Postfix) with ESMTPSA id 44CF6l67VMzkfN for ; Sun, 3 Mar 2019 20:26:23 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:156008 Archived-At: 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.