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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21893 in the body.
You can then email your comments to 21893 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#21893; Package emacs. (Thu, 12 Nov 2015 21:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 12 Nov 2015 21:09:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; Using scroll-*-command in follow-mode
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))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21893; Package emacs. (Tue, 25 Jun 2019 14:56:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 21893 <at> debbugs.gnu.org
Subject: Re: bug#21893: 25.0.50; Using scroll-*-command in follow-mode
Date: Tue, 25 Jun 2019 16:55:15 +0200
Juri Linkov <juri <at> linkov.net> writes:

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

[...]

> -	 (scroll-up arg))
> +	 (scroll-up-command arg))

Your patch basically replaces some of the calls to scroll-{up,down} with
scroll-{up/down}-command, which I think makes sense, since this is
supposed to emulate the normal scroll up/down commands, as far as I can
tell.

But the patch no longer applies, and I don't use follow mode.  Could a
follow mode user say whether this is what they'd expect, and if so, spin
a new patch?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21893; Package emacs. (Tue, 25 Jun 2019 20:12:02 GMT) Full text and rfc822 format available.

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

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: Re: bug#21893: 25.0.50; Using scroll-*-command in follow-mode
Date: Tue, 25 Jun 2019 23:10:50 +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?

>> 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.
>
> [...]
>
>> -	 (scroll-up arg))
>> +	 (scroll-up-command arg))
>
> Your patch basically replaces some of the calls to scroll-{up,down} with
> scroll-{up/down}-command, which I think makes sense, since this is
> supposed to emulate the normal scroll up/down commands, as far as I can
> tell.
>
> But the patch no longer applies, and I don't use follow mode.  Could a
> follow mode user say whether this is what they'd expect, and if so, spin
> a new patch?

[follow-scroll-command.patch (text/x-diff, inline)]
diff --git a/lisp/follow.el b/lisp/follow.el
index acc2b26c55..4269bf7cb1 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,12 +635,14 @@ 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))
+	   (if (and (eq end (point-max))
+                    (or (null scroll-error-top-bottom)
+                        (eobp)))
 	       (signal 'end-of-buffer nil)
 	     (select-window (car windows))
 	     ;; `window-end' might return nil.
@@ -663,13 +665,15 @@ 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))
+	   (if (and (eq start (point-min))
+                    (or (null scroll-error-top-bottom)
+                        (bobp)))
 	       (signal 'beginning-of-buffer nil)
 	     (select-window win)
 	     (goto-char start)

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21893; Package emacs. (Thu, 04 Jul 2019 21:12:02 GMT) Full text and rfc822 format available.

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

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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21893; Package emacs. (Fri, 05 Jul 2019 19:14:07 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: 21893 <at> debbugs.gnu.org
Subject: Re: bug#21893: 25.0.50; Using scroll-*-command in follow-mode
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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21893; Package emacs. (Fri, 05 Jul 2019 19:26:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 21893 <at> debbugs.gnu.org
Subject: Re: bug#21893: 25.0.50; Using scroll-*-command in follow-mode
Date: Fri, 05 Jul 2019 22:25:25 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Date: Fri, 05 Jul 2019 21:44:52 +0300
> 
> BTW, view-end-message is too verbose.  Shouldn't it verbosity be customizable?

No, I don't think so.  It is not too verbose as it is, IMO.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21893; Package emacs. (Sun, 07 Jul 2019 22:37:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21893 <at> debbugs.gnu.org
Subject: Re: bug#21893: 25.0.50; Using scroll-*-command in follow-mode
Date: Mon, 08 Jul 2019 01:36:04 +0300
found 21893 25.0.50
fixed 21893 27.0.50
quit

>> BTW, view-end-message is too verbose.  Shouldn't it verbosity be customizable?
>
> No, I don't think so.  It is not too verbose as it is, IMO.

Ok, I just copied this function without messages to ~/.emacs
because it's very short to be customized conveniently.

So now after installing scroll-error-top-bottom handling to master,
I'm closing this report.




bug Marked as fixed in versions 27.0.50. Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Sun, 07 Jul 2019 22:37:02 GMT) Full text and rfc822 format available.

Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Sun, 29 Sep 2019 21:41:02 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> linkov.net>:
bug acknowledged by developer. (Sun, 29 Sep 2019 21:41:02 GMT) Full text and rfc822 format available.

Message #30 received at 21893-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 21893-done <at> debbugs.gnu.org
Subject: Re: bug#21893: 25.0.50; Using scroll-*-command in follow-mode
Date: Sun, 29 Sep 2019 23:40:04 +0200
Juri Linkov <juri <at> linkov.net> writes:

> So now after installing scroll-error-top-bottom handling to master,
> I'm closing this report.

Seems like this was left open by mistake; closing now.

Best regards,
Stefan Kangas




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 28 Oct 2019 11:24:18 GMT) Full text and rfc822 format available.

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

Previous Next


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