Mercurial > emacs
comparison lisp/eshell/em-smart.el @ 31241:3099993cba0f
See ChangeLog
author | John Wiegley <johnw@newartisans.com> |
---|---|
date | Tue, 29 Aug 2000 00:47:45 +0000 |
parents | 10b1c85c0bbe |
children | 8e57189d61b4 |
comparison
equal
deleted
inserted
replaced
31240:10b1c85c0bbe | 31241:3099993cba0f |
---|---|
256 | 256 |
257 (defun eshell-smart-redisplay () | 257 (defun eshell-smart-redisplay () |
258 "Display as much output as possible, smartly." | 258 "Display as much output as possible, smartly." |
259 (if (eobp) | 259 (if (eobp) |
260 (recenter -1) | 260 (recenter -1) |
261 (and (memq 'eshell-smart-display-move pre-command-hook) | 261 (let ((top-point (point))) |
262 (>= (point) eshell-last-input-start) | 262 (and (memq 'eshell-smart-display-move pre-command-hook) |
263 (< (point) eshell-last-input-end) | 263 (>= (point) eshell-last-input-start) |
264 (set-window-start (selected-window) | 264 (< (point) eshell-last-input-end) |
265 (line-beginning-position) t)) | 265 (set-window-start (selected-window) |
266 (if (pos-visible-in-window-p (point-max)) | 266 (line-beginning-position) t)) |
267 (save-excursion | 267 (if (pos-visible-in-window-p (point-max)) |
268 (goto-char (point-max)) | 268 (save-excursion |
269 (recenter -1))))) | 269 (goto-char (point-max)) |
270 (recenter -1) | |
271 (unless (pos-visible-in-window-p top-point) | |
272 (goto-char top-point) | |
273 (set-window-start (selected-window) | |
274 (line-beginning-position) t))))))) | |
270 | 275 |
271 (defun eshell-smart-goto-end () | 276 (defun eshell-smart-goto-end () |
272 "Like `end-of-buffer', but do not push a mark." | 277 "Like `end-of-buffer', but do not push a mark." |
273 (interactive) | 278 (interactive) |
274 (goto-char (point-max))) | 279 (goto-char (point-max))) |