Subject: Re: bug#21893: 25.0.50; Using scroll-*-command in follow-mode

From: Juri Linkov <[email-masked]>
Date: Fri, 05 Jul 2019 21:44:52 +0300

>> 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:

The same problem of ignoring customization of scroll-error-top-bottom
exists in view-mode too, and this patch fixes it:

diff --git a/lisp/view.el b/lisp/view.el
index a765be02c1..e4489b391a 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -743,18 +743,19 @@ view-scroll-lines
     (setq backward (not backward) lines (- lines)))
   (when (and maxdefault lines (> lines (view-window-size)))
     (setq lines nil))
-  (cond (backward (scroll-down lines))
+  (cond (backward (scroll-down-command lines))
 	((view-really-at-end)
 	 (if view-scroll-auto-exit
 	     (View-quit)
 	   (ding)
 	   (view-end-message)))
-	(t (scroll-up lines)
+	(t (scroll-up-command lines)
 	   (if (view-really-at-end) (view-end-message)))))
 
 (defun view-really-at-end ()
   ;; Return true if buffer end visible.  Maybe revert buffer and test.
-  (and (pos-visible-in-window-p (point-max))
+  (and (or (null scroll-error-top-bottom) (eobp))
+       (pos-visible-in-window-p (point-max))
        (let ((buf (current-buffer))
 	     (bufname (buffer-name))
 	     (file (buffer-file-name)))

BTW, view-end-message is too verbose.  Shouldn't it verbosity be customizable?