diff options
| author | Jan D <jan.h.d@swipnet.se> | 2015-04-26 13:55:01 +0200 |
|---|---|---|
| committer | Jan D <jan.h.d@swipnet.se> | 2015-04-26 13:55:01 +0200 |
| commit | f92ac2e82ed199d6f25d2a59508e08addb1150ac (patch) | |
| tree | d7d7756e3dbce10d8f73c27815d815499f78c2bd /lisp/eshell/esh-mode.el | |
| parent | 5a094119ce79723108abd90a1fcc33721e964823 (diff) | |
| parent | a40869789fc5502e3d4e393b7c31d78cb7f29aa1 (diff) | |
| download | emacs-f92ac2e82ed199d6f25d2a59508e08addb1150ac.tar.gz | |
Merge branch 'master' into cairo
Diffstat (limited to 'lisp/eshell/esh-mode.el')
| -rw-r--r-- | lisp/eshell/esh-mode.el | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 15120cb61d4..222e801301b 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -871,12 +871,20 @@ When run interactively, widen the buffer first." (goto-char (point-max)) (recenter -1)) -(defun eshell/clear () - "Scroll contents of eshell window out of sight, leaving a blank window." +(defun eshell/clear (&optional scrollback) + "Scroll contents of eshell window out of sight, leaving a blank window. +If SCROLLBACK is non-nil, clear the scrollback contents." (interactive) - (let ((number-newlines (count-lines (window-start) (point)))) - (insert (make-string number-newlines ?\n))) - (eshell-send-input)) + (if scrollback + (eshell/clear-scrollback) + (let ((number-newlines (count-lines (window-start) (point)))) + (insert (make-string number-newlines ?\n)) + (eshell-send-input)))) + +(defun eshell/clear-scrollback () + "Clear the scrollback content of the eshell window." + (let ((inhibit-read-only t)) + (erase-buffer))) (defun eshell-get-old-input (&optional use-current-region) "Return the command input on the current line." |
