all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Alan Mackenzie <acm@muc.de>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 21893@debbugs.gnu.org
Subject: bug#21893: 25.0.50; Using scroll-*-command in follow-mode
Date: Fri, 05 Jul 2019 00:01:15 +0300	[thread overview]
Message-ID: <87wogxwm3o.fsf@mail.linkov.net> (raw)
In-Reply-To: <875zotzb69.fsf@mail.linkov.net> (Juri Linkov's message of "Tue,  25 Jun 2019 23:10:50 +0300")

[-- Attachment #1: Type: text/plain, Size: 273 bytes --]

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: follow-scroll-command.2.patch --]
[-- Type: text/x-diff, Size: 2719 bytes --]

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)

  reply	other threads:[~2019-07-04 21:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 21:07 bug#21893: 25.0.50; Using scroll-*-command in follow-mode Juri Linkov
2019-06-25 14:55 ` Lars Ingebrigtsen
2019-06-25 20:10   ` Juri Linkov
2019-07-04 21:01     ` Juri Linkov [this message]
2019-07-05 18:44       ` Juri Linkov
2019-07-05 19:25         ` Eli Zaretskii
2019-07-07 22:36           ` Juri Linkov
2019-09-29 21:40 ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wogxwm3o.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=21893@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.