Function: follow-scroll-down

follow-scroll-down is an autoloaded, interactive and byte-compiled function defined in follow.el.gz.

Signature

(follow-scroll-down &optional ARG)

Documentation

Scroll text in a Follow mode window chain down.

If called with no ARG, the next-screen-context-lines top lines of the top window in the chain will be visible in the bottom window.

If called with an argument, scroll ARG lines down. Negative ARG means scroll upward.

Works like scroll-down when not in Follow mode.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/follow.el.gz
;;;###autoload
(defun follow-scroll-down (&optional arg)
  "Scroll text in a Follow mode window chain down.

If called with no ARG, the `next-screen-context-lines' top lines of
the top window in the chain will be visible in the bottom window.

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-command arg))
	(arg (follow-scroll-down-arg arg))
        (t
	 (let* ((orig-point (point))
                (windows (follow-all-followers))
		(start (window-start (car windows)))
                (lines 0))
	   (if (eq start (point-min))
	       (if (or (null scroll-error-top-bottom)
		       (bobp))
		   (signal 'beginning-of-buffer nil)
		 (goto-char (point-min)))
             (select-window (car windows))
             (dolist (win windows)
               (setq lines
                     (+ lines
                        (- (window-height win)
                           (if header-line-format 2 1) ; Count mode-line, too.
                           (if tab-line-format 1 0)))))
             (setq lines (- lines next-screen-context-lines))
             (goto-char start)
             (let ((at-top (> (vertical-motion (- lines)) (- lines))))
               (set-window-start (car windows) (point))
               (if at-top
                   (goto-char orig-point)
                 (goto-char start)
                 (vertical-motion (- next-screen-context-lines 1))
                 (if (< orig-point (point))
                     (goto-char orig-point))))
	     (setq follow-internal-force-redisplay t))))))