Function: comint-preinput-scroll-to-bottom

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

Signature

(comint-preinput-scroll-to-bottom)

Documentation

Go to the end of buffer in all windows showing it.

Movement occurs if point in the selected window is not after the process mark, and this-command is an insertion command. Insertion commands recognized are self-insert-command, comint-magic-space, yank, and hilit-yank. Depends on the value of comint-scroll-to-bottom-on-input.

This function should be a pre-command hook.

Source Code

;; Defined in /usr/src/emacs/lisp/comint.el.gz
(defun comint-preinput-scroll-to-bottom ()
  "Go to the end of buffer in all windows showing it.
Movement occurs if point in the selected window is not after the process mark,
and `this-command' is an insertion command.  Insertion commands recognized
are `self-insert-command', `comint-magic-space', `yank', and `hilit-yank'.
Depends on the value of `comint-scroll-to-bottom-on-input'.

This function should be a pre-command hook."
  (if (and comint-scroll-to-bottom-on-input
	   (memq this-command '(self-insert-command comint-magic-space yank
				hilit-yank)))
      (let* ((current (current-buffer))
	     (process (get-buffer-process current))
	     (scroll comint-scroll-to-bottom-on-input))
	(if (and process (< (point) (process-mark process)))
	    (if (eq scroll 'this)
		(goto-char (point-max))
	      (walk-windows
               (lambda (window)
                 (if (and (eq (window-buffer window) current)
                          (or (eq scroll t) (eq scroll 'all)))
                     (with-selected-window window
                       (goto-char (point-max)))))
	       nil t))))))