Function: follow-select-if-end-visible

follow-select-if-end-visible is a byte-compiled function defined in follow.el.gz.

Signature

(follow-select-if-end-visible WIN-START-END)

Documentation

Select and return a window, if end is visible in it.

Source Code

;; Defined in /usr/src/emacs/lisp/follow.el.gz
;; Lets select a window showing the end.  Make sure we only select it if
;; it wasn't just moved here.  (I.e. M-> shall not unconditionally place
;; point in the selected window.)

(defun follow-select-if-end-visible (win-start-end)
  "Select and return a window, if end is visible in it."
  (let ((win nil))
    (while (and (not win) win-start-end)
      ;; Don't select a window that was just moved. This makes it
      ;; possible to later select the last window after a `end-of-buffer'
      ;; command.
      (if (and (eq (point-max) (nth 2 (car win-start-end)))
	       (nth 3 (car win-start-end))
               (eq (point-max) (window-end (caar win-start-end))))
	  (progn
	    (setq win (car (car win-start-end)))
	    (select-window win)))
      (setq win-start-end (cdr win-start-end)))
    win))