GNU bug report logs - #21893
25.0.50; Using scroll-*-command in follow-mode

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 12 Nov 2015 21:09:02 UTC

Severity: wishlist

Tags: patch

Found in version 25.0.50

Fixed in version 27.0.50

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 21893 <at> debbugs.gnu.org
Subject: bug#21893: 25.0.50; Using scroll-*-command in follow-mode
Date: Fri, 05 Jul 2019 00:01:15 +0300
[Message part 1 (text/plain, inline)]
Hello, Alan.

> Lars reminded me of this old report that tries to add support for
> a non-nil value of scroll-error-top-bottom for scrolling in follow-mode.
>
> Now I updated the patch for the current master.
> Do you think this is the right fix?

Here is a better patch:

[follow-scroll-command.2.patch (text/x-diff, inline)]
diff --git a/lisp/follow.el b/lisp/follow.el
index acc2b26c55..faac87986b 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -557,7 +557,7 @@ follow-scroll-up-arg
   (let ((opoint (point))  (owin (selected-window)))
     (while
         ;; If we are too near EOB, try scrolling the previous window.
-        (condition-case nil (progn (scroll-up arg) nil)
+        (condition-case nil (progn (scroll-up-command arg) nil)
           (end-of-buffer
            (condition-case nil (progn (follow-previous-window) t)
              (error
@@ -576,7 +576,7 @@ follow-scroll-down-arg
 This is an internal function for `follow-scroll-down' and
 `follow-scroll-down-window'."
   (let ((opoint (point)))
-    (scroll-down arg)
+    (scroll-down-command arg)
     (unless (and scroll-preserve-screen-position
                  (get this-command 'scroll-command))
       (goto-char opoint))
@@ -596,7 +596,7 @@ follow-scroll-up-window
 Works like `scroll-up' when not in Follow mode."
   (interactive "P")
   (cond ((not follow-mode)
-	 (scroll-up arg))
+	 (scroll-up-command arg))
 	((eq arg '-)
 	 (follow-scroll-down-window))
 	(t (follow-scroll-up-arg arg))))
@@ -616,7 +616,7 @@ follow-scroll-down-window
 Works like `scroll-down' when not in Follow mode."
   (interactive "P")
   (cond ((not follow-mode)
-	 (scroll-down arg))
+	 (scroll-down-command arg))
 	((eq arg '-)
 	 (follow-scroll-up-window))
 	(t (follow-scroll-down-arg arg))))
@@ -635,13 +635,16 @@ follow-scroll-up
 Works like `scroll-up' when not in Follow mode."
   (interactive "P")
   (cond ((not follow-mode)
-	 (scroll-up arg))
+	 (scroll-up-command arg))
 	(arg (follow-scroll-up-arg arg))
         (t
 	 (let* ((windows (follow-all-followers))
 		(end (window-end (car (reverse windows)))))
 	   (if (eq end (point-max))
-	       (signal 'end-of-buffer nil)
+	       (if (or (null scroll-error-top-bottom)
+		       (eobp))
+		   (signal 'end-of-buffer nil)
+		 (goto-char (point-max)))
 	     (select-window (car windows))
 	     ;; `window-end' might return nil.
 	     (if end
@@ -663,14 +666,17 @@ follow-scroll-down
 Works like `scroll-down' when not in Follow mode."
   (interactive "P")
   (cond ((not follow-mode)
-	 (scroll-down arg))
+	 (scroll-down-command arg))
 	(arg (follow-scroll-down-arg arg))
         (t
 	 (let* ((windows (follow-all-followers))
 		(win (car (reverse windows)))
 		(start (window-start (car windows))))
 	   (if (eq start (point-min))
-	       (signal 'beginning-of-buffer nil)
+	       (if (or (null scroll-error-top-bottom)
+		       (bobp))
+		   (signal 'beginning-of-buffer nil)
+		 (goto-char (point-min)))
 	     (select-window win)
 	     (goto-char start)
 	     (vertical-motion (- (- (window-height win)

This bug report was last modified 5 years and 236 days ago.

Previous Next


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