Function: follow-comint-scroll-to-bottom

follow-comint-scroll-to-bottom is a byte-compiled function defined in follow.el.gz.

Signature

(follow-comint-scroll-to-bottom &optional WINDOW)

Documentation

Scroll the bottom-most window in the current Follow chain.

This is to be called by comint-postoutput-scroll-to-bottom.

Source Code

;; Defined in /usr/src/emacs/lisp/follow.el.gz
(defun follow-comint-scroll-to-bottom (&optional _window)
  "Scroll the bottom-most window in the current Follow chain.
This is to be called by `comint-postoutput-scroll-to-bottom'."
  (let* ((buffer (current-buffer))
	 (selected (selected-window))
	 (is-selected (eq (window-buffer) buffer))
	 some-window)
    (when (or is-selected
	      (setq some-window (get-buffer-window)))
      (let* ((pos (progn (comint-adjust-point nil) (point)))
	     (win (if is-selected
		      selected
		    (car (last (follow-all-followers some-window))))))
	(select-window win)
	(goto-char pos)
	(setq follow-windows-start-end-cache nil)
	(follow-adjust-window win)
	(unless is-selected
	  (select-window selected)
	  (set-buffer buffer))))))