From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.bugs Subject: bug#23347: 25.0.92; Follow mode scrolling broken -- scrolls only one page Date: Tue, 26 Apr 2016 15:08:31 +0200 Message-ID: References: <20160424090035.87856.qmail@mail.muc.de> <20160424142313.GB3517@acm.fritz.box> <20160426115108.GC3033@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114408d461ba3d053162fd4c X-Trace: ger.gmane.org 1461676162 15832 80.91.229.3 (26 Apr 2016 13:09:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Apr 2016 13:09:22 +0000 (UTC) Cc: 23347@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 26 15:09:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1av2jo-0005Sg-K3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Apr 2016 15:09:12 +0200 Original-Received: from localhost ([::1]:37886 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av2jn-0007al-8r for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Apr 2016 09:09:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av2ji-0007XF-2t for bug-gnu-emacs@gnu.org; Tue, 26 Apr 2016 09:09:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1av2je-0000fk-Oc for bug-gnu-emacs@gnu.org; Tue, 26 Apr 2016 09:09:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av2je-0000fe-Jb for bug-gnu-emacs@gnu.org; Tue, 26 Apr 2016 09:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1av2je-00056C-8E for bug-gnu-emacs@gnu.org; Tue, 26 Apr 2016 09:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Anders Lindgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Apr 2016 13:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23347-submit@debbugs.gnu.org id=B23347.146167611819571 (code B ref 23347); Tue, 26 Apr 2016 13:09:02 +0000 Original-Received: (at 23347) by debbugs.gnu.org; 26 Apr 2016 13:08:38 +0000 Original-Received: from localhost ([127.0.0.1]:47578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1av2jG-00055b-3T for submit@debbugs.gnu.org; Tue, 26 Apr 2016 09:08:38 -0400 Original-Received: from mail-vk0-f48.google.com ([209.85.213.48]:33120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1av2jE-00055M-Ko for 23347@debbugs.gnu.org; Tue, 26 Apr 2016 09:08:37 -0400 Original-Received: by mail-vk0-f48.google.com with SMTP id o133so15727141vka.0 for <23347@debbugs.gnu.org>; Tue, 26 Apr 2016 06:08:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=cfzM11zz6RcKEwquX+yjwR7ryGQYvC3Ymthn8aPbdG0=; b=i3eCLD7Ee+zO5Sn+OL97MxhZpk+O7UQpHDBb02JjERrYI7yEBXfQUSh09nCK8/Iasy QHACqHsWcoTc/44izXRd/doqxxq3cQcIbcJQ8l3ThCM8UgbCCLP1LGDBeQYhmQ0etP6/ T2gBmLE2YnficjGEhltbz6nMMakKEZvSPiZKWOjaDVOIRTllF+Fx/WRcYGlgom9cm1zQ ZCnS4hIsTuqYN05cBn4FmnWxPQtYtHsgX0/C/Vvvn64ulOWtL9Q9BO/gw8/gQ5Ibmthn jvKKA6v2KStdUOC14yBmWHG4LYYgKJk/CKaoXtYpPvJzRypMn3GOz9gnYt1abPBAw1K3 tgFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=cfzM11zz6RcKEwquX+yjwR7ryGQYvC3Ymthn8aPbdG0=; b=FNq2HqHok8Sd9AEXweOvVGQsHbvtfSS/s3mpgOyZ0rrOEyCosC7RaeajO8Smr2NC43 hgZGZDE4bjatfrl4xoPPQzyncGSLBJ6a9oISP/ITsfMJRmIlI9rd4kpBSc6ifIblOeMP n4l4uzeC64lDsmFnvZ/oLTm7/9w24ntls+wuFkzu8Ryi2l1eHyny+z43dO6UZa2dLTLW geWv+y7fXFd0X9jQSLV+ElBcgnLIXLzE5Hbe+TSsWlPkAJ+Zwg76EHvNd3ObTItP5uXm SiOAaNdvmsFhZPQndk8DOFScvEez/VzXQBwQpwpvT5rgBb0/VFUYoqjfei47QaM0YJwB lQbg== X-Gm-Message-State: AOPr4FURBqamiQgtWYLgBMa7I+fUdq0DCeTMkQuiRfZUDRz3dc1MyAhbegKfAqbrOOsWcwQG77qU4OSeDjnesA== X-Received: by 10.31.172.81 with SMTP id v78mr1240120vke.70.1461676111147; Tue, 26 Apr 2016 06:08:31 -0700 (PDT) Original-Received: by 10.31.214.131 with HTTP; Tue, 26 Apr 2016 06:08:31 -0700 (PDT) In-Reply-To: <20160426115108.GC3033@acm.fritz.box> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:116865 Archived-At: --001a114408d461ba3d053162fd4c Content-Type: text/plain; charset=UTF-8 Hi! I just tested this and I can confirm that it works, as far as I can tell! I tested the "old" scroll functions `follow-scroll-up' and `-down' and now they scroll the entire display, hence the bug I initially reported is fixed. I tested with positive and negative numerical arguments and the corresponding number of lines were scrolled, in the correct direction. I tested the new "window" scroll functions and they work as well -- with and without arguments. I noticed some area where this could be improved upon, however they are minor and I think we should address them after the emacs-25 release: + The new "window" scroll functions scroll almost a window. The effect is that normally the point is moved from one window to the next. However, if the cursor is at the bottom of a window the user do a `follow-scroll-up-window', the point ens up at the top of the same window, which could be a bit confusing. (In other words, skip the `next-screen-context-lines' part. When using Follow mode, there is enough context anyway.) + Now both `follow-scroll-up' and `follow-scroll-up-window' scroll ARG lines when presented with an argument. It would be nice if either one of them could scroll ARG windows instead. (Where "one window" could be seen as the number of lines of the current window.) I think it would make most sense to apply this change to `follow-scroll-up'. + Documentation: In `follow-scroll-up-window' -- we should mention the difference is compared to `scroll-up' (that the point isn't moved, if it can be displayed in another window). In `follow-scroll-up' -- Make it clear what the difference between this and `follow-scroll-up-window' is (that it scroll the entire display). Finally -- Many, many thanks for all the work you have put into this! -- Anders On Tue, Apr 26, 2016 at 1:51 PM, Alan Mackenzie wrote: > Hello, Anders. > > On Sun, Apr 24, 2016 at 05:37:57PM +0200, Anders Lindgren wrote: > > Hi! > > > Agreed. All three scroll commands (non-follow-mode scroll, scroll one > page, > > and scroll N pages) are useful. > > [ .... ] > > > Yes, I agree, `page' isn't a good choice. > > > What about `follow-scroll-up-keep-point'? That way it would be clear what > > the difference is between it and the normal scroll command. > > > If I would have designed Follow mode today, I probably would have used > your > > name, `follow-scroll-up-window', and named the N-page scroll > > `follow-scroll-up-window-group'. > > I've just used `follow-scroll-up-window' and > `follow-scroll-down-window'. At least, for now. > > [ .... ] > > > Anyway, here is what I think we can agree on: > > > 1. `follow-scroll-up/down' should scroll by N windows. > > > 2. There need to be commands in follow.el that scroll by 1 window as is > > > done by the current `follow-scroll-up/down'. You have suggested the > > > name `follow-scroll-up/down-one-page'. I have countered with > > > `follow-scroll-up/down-window'. > > > > If we can agree, I'm willing to amend follow.el. I think it's probably > > > too late for this fix to make it into Emacs 25.1, though. > > > > > > Well, give it a try. Feel free to pick a suitable name. If we come up > with > > a clean solution quickly John might accept it. > > OK. I had one or two minor problems with follow-scroll-up/down with a > non-nil ARG. In the end, I just extracted functionality from > follow-scroll-up/down-window into separate functions, and called those > from all four scrolling functions. > > Anyway, here is the patch I've come up with. Could you review it and > test it, please. Thanks! > > > diff --git a/lisp/follow.el b/lisp/follow.el > index 5801f79..3e23247 100644 > --- a/lisp/follow.el > +++ b/lisp/follow.el > @@ -532,6 +532,80 @@ follow-get-scrolled-point > ;; position... (This would also be corrected if we would have had a > ;; good redisplay abstraction.) > > +(defun follow-scroll-up-arg (arg) > + "Scroll the text in a follow mode window chain up by ARG lines. > +If ARG is nil, scroll the size of the current window. > + > +This is an internal function for `follow-scroll-up' and > +`follow-scroll-up-window'." > + (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) > + (end-of-buffer > + (condition-case nil (progn (follow-previous-window) t) > + (error > + (select-window owin) > + (goto-char opoint) > + (signal 'end-of-buffer nil)))))) > + (unless (and scroll-preserve-screen-position > + (get this-command 'scroll-command)) > + (goto-char opoint)) > + (setq follow-fixed-window t))) > + > +(defun follow-scroll-down-arg (arg) > + "Scroll the text in a follow mode window chain down by ARG lines. > +If ARG is nil, scroll the size of the current window. > + > +This is an internal function for `follow-scroll-down' and > +`follow-scroll-down-window'." > + (let ((opoint (point))) > + (scroll-down arg) > + (unless (and scroll-preserve-screen-position > + (get this-command 'scroll-command)) > + (goto-char opoint)) > + (setq follow-fixed-window t))) > + > +;;;###autoload > +(defun follow-scroll-up-window (&optional arg) > + "Scroll text in a Follow mode window up by that window's size. > +The other windows in the window chain will scroll synchronously. > + > +If called with no ARG, the `next-screen-context-lines' last lines of > +the window will be visible after the scroll. > + > +If called with an argument, scroll ARG lines up. > +Negative ARG means scroll downward. > + > +Works like `scroll-up' when not in Follow mode." > + (interactive "P") > + (cond ((not follow-mode) > + (scroll-up arg)) > + ((eq arg '-) > + (follow-scroll-down-window)) > + (t (follow-scroll-up-arg arg)))) > +(put 'follow-scroll-up-window 'scroll-command t) > + > +;;;###autoload > +(defun follow-scroll-down-window (&optional arg) > + "Scroll text in a Follow mode window down by that window's size. > +The other windows in the window chain will scroll synchronously. > + > +If called with no ARG, the `next-screen-context-lines' top lines of > +the window in the chain will be visible after the scroll. > + > +If called with an argument, scroll ARG lines down. > +Negative ARG means scroll upward. > + > +Works like `scroll-down' when not in Follow mode." > + (interactive "P") > + (cond ((not follow-mode) > + (scroll-down arg)) > + ((eq arg '-) > + (follow-scroll-up-window)) > + (t (follow-scroll-down-arg arg)))) > +(put 'follow-scroll-down-window 'scroll-command t) > + > ;;;###autoload > (defun follow-scroll-up (&optional arg) > "Scroll text in a Follow mode window chain up. > @@ -546,23 +620,18 @@ follow-scroll-up > (interactive "P") > (cond ((not follow-mode) > (scroll-up 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) > - (end-of-buffer > - (condition-case nil (progn (follow-previous-window) t) > - (error > - (select-window owin) > - (goto-char opoint) > - (signal 'end-of-buffer nil)))))) > - (unless (and scroll-preserve-screen-position > - (get this-command 'scroll-command)) > - (goto-char opoint)) > - (setq follow-fixed-window t))))) > + (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) > + (select-window (car windows)) > + ;; `window-end' might return nil. > + (if end > + (goto-char end)) > + (vertical-motion (- next-screen-context-lines)) > + (set-window-start (car windows) (point))))))) > (put 'follow-scroll-up 'scroll-command t) > > ;;;###autoload > @@ -579,15 +648,22 @@ follow-scroll-down > (interactive "P") > (cond ((not follow-mode) > (scroll-down arg)) > - ((eq arg '-) > - (follow-scroll-up)) > - (t > - (let ((opoint (point))) > - (scroll-down arg) > - (unless (and scroll-preserve-screen-position > - (get this-command 'scroll-command)) > - (goto-char opoint)) > - (setq follow-fixed-window t))))) > + (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) > + (select-window win) > + (goto-char start) > + (vertical-motion (- (- (window-height win) > + (if header-line-format 2 1) > + next-screen-context-lines))) > + (set-window-start win (point)) > + (goto-char start) > + (vertical-motion (- next-screen-context-lines 1)) > + (setq follow-internal-force-redisplay t)))))) > (put 'follow-scroll-down 'scroll-command t) > > (declare-function comint-adjust-point "comint" (window)) > > > > -- Anders > > -- > Alan Mackenzie (Nuremberg, Germany). > --001a114408d461ba3d053162fd4c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi!

I just tested this and I can confir= m that it works, as far as I can tell!


<= div>I tested the "old" scroll functions `follow-scroll-up' an= d `-down' and now they scroll the entire display, hence the bug I initi= ally reported is fixed.

I tested with positive and= negative numerical arguments and the corresponding number of lines were sc= rolled, in the correct direction.

I tested the new= "window" scroll functions and they work as well -- with and with= out arguments.


I noticed some area = where this could be improved upon, however they are minor and I think we sh= ould address them after the emacs-25 release:

+ Th= e new "window" scroll functions scroll almost a window. The effec= t is that normally the point is moved from one window to the next. However,= if the cursor is at the bottom of a window the user do a `follow-scroll-up= -window', the point ens up at the top of the same window, which could b= e a bit confusing. (In other words, skip the `next-screen-context-lines'= ; part. When using Follow mode, there is enough context anyway.)
=
+ Now both `follow-scroll-up' and `follow-scroll-up-wind= ow' scroll ARG lines when presented with an argument. It would be nice = if either one of them could scroll ARG windows instead. (Where "one wi= ndow" could be seen as the number of lines of the current window.) I t= hink it would make most sense to apply this change to `follow-scroll-up'= ;.

+ Documentation:

In `f= ollow-scroll-up-window' -- we should mention the difference is compared= to `scroll-up' (that the point isn't moved, if it can be displayed= in another window).

In `follow-scroll-up'= -- Make it clear what the difference between this and `follow-scroll-up-wi= ndow' is (that it scroll the entire display).

=
Finally -- Many, many thanks for all the work you have put i= nto this!

=C2=A0 =C2=A0 -- Anders


On Tue, = Apr 26, 2016 at 1:51 PM, Alan Mackenzie <acm@muc.de> wrote:
Hello, Anders.

On Sun, Apr 24, 2016 at 05:37:57PM +0200, Anders Lindgren wrote:
> Hi!

> Agreed. All three scroll commands (non-follow-mode scroll= , scroll one page,
> and scroll N pages) are useful.

[ .... ]

> Yes, I agree, `page' isn't a good choice.

> What about `follow-scroll-up-keep-point'? That way it would be cle= ar what
> the difference is between it and the normal scroll command.

> If I would have designed Follow mode today, I probably would have used= your
> name, `follow-scroll-up-window', and named the N-page scroll
> `follow-scroll-up-window-group'.

I've just used `follow-scroll-up-window' and
`follow-scroll-down-window'.=C2=A0 At least, for now.

[ .... ]

> Anyway, here is what I think we can agree on:
> > 1. `follow-scroll-up/down' should scroll by N windows.
> > 2. There need to be commands in follow.el that scroll by 1 window= as is
> >=C2=A0 =C2=A0done by the current `follow-scroll-up/down'.=C2= =A0 You have suggested the
> >=C2=A0 =C2=A0name `follow-scroll-up/down-one-page'.=C2=A0 I ha= ve countered with
> >=C2=A0 =C2=A0`follow-scroll-up/down-window'.

> > If we can agree, I'm willing to amend follow.el.=C2=A0 I thin= k it's probably
> > too late for this fix to make it into Emacs 25.1, though.
> >

> Well, give it a try. Feel free to pick a suitable name. If we come up = with
> a clean solution quickly John might accept it.

OK.=C2=A0 I had one or two minor problems with follow-scroll-up/down= with a
non-nil ARG.=C2=A0 In the end, I just extracted functionality from
follow-scroll-up/down-window into separate functions, and called those
from all four scrolling functions.

Anyway, here is the patch I've come up with.=C2=A0 Could you review it = and
test it, please.=C2=A0 Thanks!


diff --git a/lisp/follow.el b/lisp/follow.el
index 5801f79..3e23247 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -532,6 +532,80 @@ follow-get-scrolled-point
=C2=A0;; position...=C2=A0 (This would also be corrected if we would have h= ad a
=C2=A0;; good redisplay abstraction.)

+(defun follow-scroll-up-arg (arg)
+=C2=A0 "Scroll the text in a follow mode window chain up by ARG lines= .
+If ARG is nil, scroll the size of the current window.
+
+This is an internal function for `follow-scroll-up' and
+`follow-scroll-up-window'."
+=C2=A0 (let ((opoint (point))=C2=A0 (owin (selected-window)))
+=C2=A0 =C2=A0 (while
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; If we are too near EOB, try scrolling the p= revious window.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 (condition-case nil (progn (scroll-up arg) nil= )
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end-of-buffer
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(condition-case nil (progn (follo= w-previous-window) t)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(error
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (select-window owin)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char opoint)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (signal 'end-of-buffe= r nil))))))
+=C2=A0 =C2=A0 (unless (and scroll-preserve-screen-position
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(get this-co= mmand 'scroll-command))
+=C2=A0 =C2=A0 =C2=A0 (goto-char opoint))
+=C2=A0 =C2=A0 (setq follow-fixed-window t)))
+
+(defun follow-scroll-down-arg (arg)
+=C2=A0 "Scroll the text in a follow mode window chain down by ARG lin= es.
+If ARG is nil, scroll the size of the current window.
+
+This is an internal function for `follow-scroll-down' and
+`follow-scroll-down-window'."
+=C2=A0 (let ((opoint (point)))
+=C2=A0 =C2=A0 (scroll-down arg)
+=C2=A0 =C2=A0 (unless (and scroll-preserve-screen-position
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(get this-co= mmand 'scroll-command))
+=C2=A0 =C2=A0 =C2=A0 (goto-char opoint))
+=C2=A0 =C2=A0 (setq follow-fixed-window t)))
+
+;;;###autoload
+(defun follow-scroll-up-window (&optional arg)
+=C2=A0 "Scroll text in a Follow mode window up by that window's s= ize.
+The other windows in the window chain will scroll synchronously.
+
+If called with no ARG, the `next-screen-context-lines' last lines of +the window will be visible after the scroll.
+
+If called with an argument, scroll ARG lines up.
+Negative ARG means scroll downward.
+
+Works like `scroll-up' when not in Follow mode."
+=C2=A0 (interactive "P")
+=C2=A0 (cond ((not follow-mode)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 (scroll-up arg))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0((eq arg '-)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 (follow-scroll-down-window))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0(t (follow-scroll-up-arg arg))))
+(put 'follow-scroll-up-window 'scroll-command t)
+
+;;;###autoload
+(defun follow-scroll-down-window (&optional arg)
+=C2=A0 "Scroll text in a Follow mode window down by that window's= size.
+The other windows in the window chain will scroll synchronously.
+
+If called with no ARG, the `next-screen-context-lines' top lines of +the window in the chain will be visible after the scroll.
+
+If called with an argument, scroll ARG lines down.
+Negative ARG means scroll upward.
+
+Works like `scroll-down' when not in Follow mode."
+=C2=A0 (interactive "P")
+=C2=A0 (cond ((not follow-mode)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 (scroll-down arg))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0((eq arg '-)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 (follow-scroll-up-window))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0(t (follow-scroll-down-arg arg))))
+(put 'follow-scroll-down-window 'scroll-command t)
+
=C2=A0;;;###autoload
=C2=A0(defun follow-scroll-up (&optional arg)
=C2=A0 =C2=A0"Scroll text in a Follow mode window chain up.
@@ -546,23 +620,18 @@ follow-scroll-up
=C2=A0 =C2=A0(interactive "P")
=C2=A0 =C2=A0(cond ((not follow-mode)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(scroll-up arg))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0((eq arg '-)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 (follow-scroll-down))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0(t
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((opoint (point))=C2=A0 (owin (selected-w= indow)))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (while
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; If we are too near EOB= , try scrolling the previous window.
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (condition-case nil (prog= n (scroll-up arg) nil)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end-of-buffer
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(condition-c= ase nil (progn (follow-previous-window) t)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(erro= r
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (sel= ect-window owin)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (got= o-char opoint)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (sig= nal 'end-of-buffer nil))))))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (unless (and scroll-preserve-screen-pos= ition
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(get this-command 'scroll-command))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char opoint))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq follow-fixed-window t)))))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0(arg (follow-scroll-up-arg arg))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 (t
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let* ((windows (follow-all-followers))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(end (window-end (c= ar (reverse windows)))))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (eq end (point-max))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (signal 'end-of-buffe= r nil)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (select-window (car windows)) +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; `window-end' might return= nil.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if end
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char end)) +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (vertical-motion (- next-screen-= context-lines))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (set-window-start (car windows) = (point)))))))
=C2=A0(put 'follow-scroll-up 'scroll-command t)

=C2=A0;;;###autoload
@@ -579,15 +648,22 @@ follow-scroll-down
=C2=A0 =C2=A0(interactive "P")
=C2=A0 =C2=A0(cond ((not follow-mode)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(scroll-down arg))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0((eq arg '-)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 (follow-scroll-up))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0(t
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((opoint (point)))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (scroll-down arg)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (unless (and scroll-preserve-screen-pos= ition
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(get this-command 'scroll-command))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char opoint))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq follow-fixed-window t)))))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0(arg (follow-scroll-down-arg arg))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 (t
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let* ((windows (follow-all-followers))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(win (car (reverse = windows)))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(start (window-star= t (car windows))))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (eq start (point-min))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (signal 'beginning-of= -buffer nil)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (select-window win)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char start)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (vertical-motion (- (- (window-h= eight win)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if header-line-format = 2 1)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0next-screen-context-lin= es)))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (set-window-start win (point)) +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char start)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (vertical-motion (- next-screen-= context-lines 1))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq follow-internal-force-redi= splay t))))))
=C2=A0(put 'follow-scroll-down 'scroll-command t)

=C2=A0(declare-function comint-adjust-point "comint" (window))


>=C2=A0 =C2=A0 =C2=A0-- Anders

--
Alan Mackenzie (Nuremberg, Germany).

--001a114408d461ba3d053162fd4c--