diff options
| author | Vibhav Pant | 2015-03-17 05:01:59 +0530 |
|---|---|---|
| committer | Vibhav Pant | 2015-03-17 05:01:59 +0530 |
| commit | ab4e4cc92c62051983f4ee5f1bf9c82440086451 (patch) | |
| tree | 6437b8243bbb4b74a9748fde80d86cd540f65f0c /lisp/eshell | |
| parent | 3eb4d23a7cdee6f763b5be4947f70a1040c25424 (diff) | |
| download | emacs-ab4e4cc92c62051983f4ee5f1bf9c82440086451.tar.gz emacs-ab4e4cc92c62051983f4ee5f1bf9c82440086451.zip | |
Add 'clear' functionality to eshell.
* eshell/esh-mode.el (eshell/clear): New function.
* etc/NEWS: Mention new built-in command.
Diffstat (limited to 'lisp/eshell')
| -rw-r--r-- | lisp/eshell/esh-mode.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index da83ec6a6ab..15120cb61d4 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el | |||
| @@ -871,6 +871,13 @@ When run interactively, widen the buffer first." | |||
| 871 | (goto-char (point-max)) | 871 | (goto-char (point-max)) |
| 872 | (recenter -1)) | 872 | (recenter -1)) |
| 873 | 873 | ||
| 874 | (defun eshell/clear () | ||
| 875 | "Scroll contents of eshell window out of sight, leaving a blank window." | ||
| 876 | (interactive) | ||
| 877 | (let ((number-newlines (count-lines (window-start) (point)))) | ||
| 878 | (insert (make-string number-newlines ?\n))) | ||
| 879 | (eshell-send-input)) | ||
| 880 | |||
| 874 | (defun eshell-get-old-input (&optional use-current-region) | 881 | (defun eshell-get-old-input (&optional use-current-region) |
| 875 | "Return the command input on the current line." | 882 | "Return the command input on the current line." |
| 876 | (if use-current-region | 883 | (if use-current-region |