diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d8330a4..efb160c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2015-03-09 Vibhav Pant + + * eshell/esh-mode.el (eshell/clear): New function. + 2015-03-09 Nicolas Petton * emacs-lisp/seq.el (seq-into): New function. diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index da83ec6..15120cb 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