GNU bug report logs - #50220
27.2; follow.el: follow-recenter does not work correctly if invoked in a follow window before the middle follow window.

Previous Next

Package: emacs;

Reported by: Noah Evans <noah <at> nevans.me>

Date: Fri, 27 Aug 2021 00:40:01 UTC

Severity: normal

Found in version 27.2

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50220 in the body.
You can then email your comments to 50220 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#50220; Package emacs. (Fri, 27 Aug 2021 00:40:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Noah Evans <noah <at> nevans.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 27 Aug 2021 00:40:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Noah Evans <noah <at> nevans.me>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 27.2;
 follow.el: follow-recenter does not work correctly if invoked in a
 follow window before the middle follow window.
Date: Fri, 27 Aug 2021 00:39:26 +0000
[Message part 1 (text/plain, inline)]
In GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Arch Linux

In follow mode, 'follow-mode-recenter` with no argument should center
the middle window around point. It works fine if it is used in the
middle window or a window after it, but if it is used in a window before
middle the post-command-hook moves the window back.

Reproduce:
Find a long file.
Split the window vertically two or more times.
M-x follow-mode
Go to the leftmost window and do C-c . C-l

Patch to fix:

From 65c6ccae67a5b2744711c3bfae2ebff3e530c2c1 Mon Sep 17 00:00:00 2001
From: Noah Evans <noah <at> nevans.me>
Date: Thu, 26 Aug 2021 20:27:45 -0400
Subject: [PATCH] follow.el: Fix bug#XXXXX in follow-recenter.

When follow-recenter is called in a follow window before the middle
follow window, the post-command-hook undoes the recentering.

* list/follow.el (follow-recenter): Set
follow-internal-force-redisplay when dest point is before start of
middle window.
---
lisp/follow.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/follow.el b/lisp/follow.el
index dde140d0fd5..b64f4cb7348 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -858,8 +858,11 @@ from the bottom."
(windows (follow-all-followers))
(win (nth (/ (- (length windows) 1) 2) windows)))
(select-window win)
- (goto-char dest)
- (recenter))))
+ (let ((win-s (window-start)))
+ (goto-char dest)
+ (recenter)
+ (when (< dest win-s)
+ (setq follow-internal-force-redisplay t))))))

(defun follow-redraw ()
--
2.33.0
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50220; Package emacs. (Fri, 27 Aug 2021 01:44:01 GMT) Full text and rfc822 format available.

Message #8 received at 50220 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Noah Evans <noah <at> nevans.me>
Cc: 50220 <at> debbugs.gnu.org
Subject: Re: bug#50220: 27.2; follow.el: follow-recenter does not work
 correctly if invoked in a follow window before the middle follow window.
Date: Fri, 27 Aug 2021 03:43:33 +0200
Noah Evans <noah <at> nevans.me> writes:

> In follow mode, 'follow-mode-recenter` with no argument should center
> the middle window around point. It works fine if it is used in the
> middle window or a window after it, but if it is used in a window before
> middle the post-command-hook moves the window back.
>
> Reproduce:
> Find a long file.
> Split the window vertically two or more times.
> M-x follow-mode
> Go to the leftmost window and do C-c . C-l

Thanks; applied to Emacs 28.  (I've never used follow-mode before, but
your patch does indeed seem to fix the problem with `C-c . C-l'.)

This change was small enough to apply without assigning copyright to the
FSF, but for future patches you want to submit, it might make sense to
get the paperwork started now, so that subsequent patches can be applied
speedily. Would you be willing to sign such paperwork?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 50220 <at> debbugs.gnu.org and Noah Evans <noah <at> nevans.me> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 27 Aug 2021 01:44:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 24 Sep 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 214 days ago.

Previous Next


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