diff options
author | Vibhav Pant <vibhavp@gmail.com> | 2015-03-17 05:01:59 +0530 |
---|---|---|
committer | Vibhav Pant <vibhavp@gmail.com> | 2015-03-17 05:01:59 +0530 |
commit | ab4e4cc92c62051983f4ee5f1bf9c82440086451 (patch) | |
tree | 6437b8243bbb4b74a9748fde80d86cd540f65f0c /lisp | |
parent | 3eb4d23a7cdee6f763b5be4947f70a1040c25424 (diff) | |
download | emacs-ab4e4cc92c62051983f4ee5f1bf9c82440086451.tar.gz |
Add 'clear' functionality to eshell.
* eshell/esh-mode.el (eshell/clear): New function.
* etc/NEWS: Mention new built-in command.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 4 | ||||
-rw-r--r-- | lisp/eshell/esh-mode.el | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c6fab7fba3d..3af4bb20b04 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2015-03-16 Vibhav Pant <vibhavp@gmail.com> + + * eshell/esh-mode.el (eshell/clear): New function. + 2015-03-16 Alan Mackenzie <acm@muc.de> Make Edebug work with Follow Mode. 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." (goto-char (point-max)) (recenter -1)) +(defun eshell/clear () + "Scroll contents of eshell window out of sight, leaving a blank window." + (interactive) + (let ((number-newlines (count-lines (window-start) (point)))) + (insert (make-string number-newlines ?\n))) + (eshell-send-input)) + (defun eshell-get-old-input (&optional use-current-region) "Return the command input on the current line." (if use-current-region |