Function: eshell-smart-redisplay

eshell-smart-redisplay is a byte-compiled function defined in em-smart.el.gz.

Signature

(eshell-smart-redisplay)

Documentation

Display as much output as possible, smartly.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/em-smart.el.gz
(defun eshell-smart-redisplay ()
  "Display as much output as possible, smartly."
  (if (eobp)
      (save-excursion
	(recenter -1)
	;; trigger the redisplay now, so that we catch any attempted
	;; point motion; this is to cover for a redisplay bug
	(eshell-redisplay))
    (let ((top-point (point)))
      (and (memq 'eshell-smart-display-move pre-command-hook)
	   (>= (point) eshell-last-input-start)
	   (< (point) eshell-last-input-end)
	   (set-window-start (selected-window)
			     (line-beginning-position) t))
      (if (pos-visible-in-window-p (point-max))
	  (save-excursion
	    (goto-char (point-max))
	    (recenter -1)
	    (unless (pos-visible-in-window-p top-point)
	      (goto-char top-point)
	      (set-window-start (selected-window)
				(line-beginning-position) t)))))))