Function: follow-calc-win-end

follow-calc-win-end is a byte-compiled function defined in follow.el.gz.

Signature

(follow-calc-win-end &optional WIN)

Documentation

Calculate the end position for window WIN.

Return (END-POS END-OF-BUFFER).

Actually, the position returned is the start of the line after the last fully-visible line in WIN. END-OF-BUFFER is t when EOB is fully-visible in WIN. If WIN is nil, the selected window is used.

Source Code

;; Defined in /usr/src/emacs/lisp/follow.el.gz
(defun follow-calc-win-end (&optional win)
  "Calculate the end position for window WIN.
Return (END-POS END-OF-BUFFER).

Actually, the position returned is the start of the line after
the last fully-visible line in WIN.  END-OF-BUFFER is t when EOB
is fully-visible in WIN.  If WIN is nil, the selected window is
used."
  (let* ((win (or win (selected-window)))
	 (edges (window-inside-pixel-edges win))
	 (ht (- (nth 3 edges) (nth 1 edges)))
	 (last-line-pos (posn-point
                         (posn-at-x-y 0 (+ (window-header-line-height win)
                                           (window-tab-line-height win)
                                           (1- ht))
                                      win))))
    (if (pos-visible-in-window-p last-line-pos win)
	(let ((end (window-end win t)))
	  (list end (pos-visible-in-window-p (point-max) win)))
      (list last-line-pos nil))))