Subject: 25.0.50; Using scroll-*-command in follow-mode

From: Juri Linkov <[email-masked]>
Date: Thu, 12 Nov 2015 23:07:50 +0200

follow.el could use better commands scroll-up-command/scroll-down-command
like in this patch to work smoothly when scroll-error-top-bottom is t,
but a special condition in follow-scroll-up/follow-scroll-down
that checks for scroll-preserve-screen-position prevents from scrolling
and returns point to the old position, and there is no comment
explaining this special-casing.

diff --git a/lisp/follow.el b/lisp/follow.el
index 938c59e..fa24a28 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -518,14 +518,14 @@ (defun follow-scroll-up (&optional arg)
 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))
 	(t
 	 (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
@@ -551,12 +551,12 @@ (defun follow-scroll-down (&optional arg)
 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))
 	(t
 	 (let ((opoint (point)))
-	   (scroll-down arg)
+	   (scroll-down-command arg)
 	   (unless (and scroll-preserve-screen-position
 			(get this-command 'scroll-command))
 	     (goto-char opoint))