Function: eshell-postoutput-scroll-to-bottom
eshell-postoutput-scroll-to-bottom is a byte-compiled function defined
in esh-mode.el.gz.
Signature
(eshell-postoutput-scroll-to-bottom)
Documentation
Go to the end of buffer in all windows showing it.
Does not scroll if the current line is the last line in the buffer.
Depends on the value of eshell-scroll-to-bottom-on-output and
eshell-scroll-show-maximum-output.
This function should be in the list eshell-output-filter-functions.
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/esh-mode.el.gz
;;; jww (1999-10-23): this needs testing
(defun eshell-postoutput-scroll-to-bottom ()
"Go to the end of buffer in all windows showing it.
Does not scroll if the current line is the last line in the buffer.
Depends on the value of `eshell-scroll-to-bottom-on-output' and
`eshell-scroll-show-maximum-output'.
This function should be in the list `eshell-output-filter-functions'."
(let* ((selected (selected-window))
(current (current-buffer))
(scroll eshell-scroll-to-bottom-on-output))
(unwind-protect
(dolist (window (get-buffer-window-list current nil t))
(with-selected-window window
(when (and (< (point) eshell-last-output-end)
(or (eq scroll t) (eq scroll 'all)
;; Maybe user wants point to jump to end.
(and (eq scroll 'this)
(eq selected window))
(and (eq scroll 'others)
(not (eq selected window)))
;; If point was at the end, keep it at end.
(>= (point) eshell-last-output-start)))
(goto-char eshell-last-output-end))
;; Optionally scroll so that the text ends at the bottom of
;; the window.
(when (and eshell-scroll-show-maximum-output
(>= (point) eshell-last-output-end))
(save-excursion
(goto-char (point-max))
(recenter -1)))))
(set-buffer current))))