Function: follow-move-to-window-line

follow-move-to-window-line is a byte-compiled function defined in follow.el.gz.

Signature

(follow-move-to-window-line ARG)

Documentation

Position point relative to the Follow mode group containing the selected window.

ARG nil means position point at center of the window group. Else, ARG specifies vertical position within the window group; zero means top of the first window in the group, negative means
  relative to bottom of the last window in the group.

Source Code

;; Defined in /usr/src/emacs/lisp/follow.el.gz
(defun follow-move-to-window-line (arg)
  "Position point relative to the Follow mode group containing the selected window.
ARG nil means position point at center of the window group.
Else, ARG specifies vertical position within the window group;
zero means top of the first window in the group, negative means
  relative to bottom of the last window in the group."
  (let* ((windows (follow-all-followers))
         (start-end (follow-windows-start-end windows))
         (rev-start-end (reverse start-end))
         (lines 0)
         elt count)
    (select-window
     (cond
      ((null arg)
       (setq rev-start-end (nthcdr (/ (length windows) 2) rev-start-end))
       (prog1 (car (car rev-start-end))
         (while (setq rev-start-end (cdr rev-start-end))
           (setq elt (car rev-start-end)
                 count (count-screen-lines (cadr elt) (nth 2 elt)
                                           nil (car elt))
                 lines (+ lines count)))))
      ((>= arg 0)
       (while (and (cdr start-end)
                   (progn
                     (setq elt (car start-end)
                           count (count-screen-lines (cadr elt) (nth 2 elt)
                                                     nil (car elt)))
                     (>= arg count)))
         (setq arg (- arg count)
               lines (+ lines count)
               start-end (cdr start-end)))
       (car (car start-end)))
      (t                                ; (< arg 0)
       (while (and (cadr rev-start-end)
                   (progn
                     (setq elt (car rev-start-end)
                           count (count-lines (cadr elt) (nth 2 elt)))
                     (<= arg (- count))))
         (setq arg (+ arg count)
               rev-start-end (cdr rev-start-end)))
       (prog1 (car (car rev-start-end))
         (while (setq rev-start-end (cdr rev-start-end))
           (setq elt (car rev-start-end)
                 count (count-screen-lines (cadr elt) (nth 2 elt)
                                           nil (car elt))
                 lines (+ lines count)))))))
    (+ lines (move-to-window-line arg))))