emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add function eshell/clear to clear current eshell buffer


From: Ted Zlatanov
Subject: Re: Add function eshell/clear to clear current eshell buffer
Date: Sat, 18 Apr 2015 19:06:44 -0400
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

On Sun, 19 Apr 2015 01:43:49 +0530 address@hidden wrote: 

v> Attached a patch which adds a clear-scrollback command to eshell. If it
v> looks good, I'll push the patch to master with the relevant info in
v> etc/NEWS.

v> diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
v> index 15120cb..21026b2 100644
v> --- a/lisp/eshell/esh-mode.el
v> +++ b/lisp/eshell/esh-mode.el
v> @@ -878,6 +878,12 @@ When run interactively, widen the buffer first."
v>      (insert (make-string number-newlines ?\n)))
v>      (eshell-send-input))
 
v> +(defun eshell/clear-scrollback ()
v> +    "Clear the scrollback content of the eshell window."
v> +  (interactive)
v> +  (let ((inhibit-read-only t))
v> +    (erase-buffer)))
v> +
v>  (defun eshell-get-old-input (&optional use-current-region)
v>    "Return the command input on the current line."
v>    (if use-current-region

That looks great.  Could you also make it available through
`C-u M-x eshell/clear'?  Or maybe "clear t" at the prompt?  Whatever you
think is best.

Ted




reply via email to

[Prev in Thread] Current Thread [Next in Thread]