diff options
author | John Wiegley <johnw@newartisans.com> | 2000-08-29 00:47:45 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2000-08-29 00:47:45 +0000 |
commit | ca7aae916bab6783c5133d8432b61d97b8ffa923 (patch) | |
tree | 1b36d8d391a6a0c166fd27a01acbc92a92020530 /lisp/eshell/em-smart.el | |
parent | b4bd214e74d885552fe38051253dbc2b362bfe67 (diff) | |
download | emacs-ca7aae916bab6783c5133d8432b61d97b8ffa923.tar.gz |
See ChangeLog
Diffstat (limited to 'lisp/eshell/em-smart.el')
-rw-r--r-- | lisp/eshell/em-smart.el | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el index 0d5a2732dd5..d7db23a0f9b 100644 --- a/lisp/eshell/em-smart.el +++ b/lisp/eshell/em-smart.el @@ -258,15 +258,20 @@ and the end of the buffer are still visible." "Display as much output as possible, smartly." (if (eobp) (recenter -1) - (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))))) + (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))))))) (defun eshell-smart-goto-end () "Like `end-of-buffer', but do not push a mark." |