help-gnu-emacs
[Top][All Lists]
Advanced

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

How to erase most of buffer in eshell mode, but not all?


From: Steven Degutis
Subject: How to erase most of buffer in eshell mode, but not all?
Date: Wed, 1 May 2013 21:52:45 -0500

I currently have this useful function bound to Cmd-K (on a Mac):

(defun sd/clear-eshell-buffer ()
  (interactive)
  (let ((inhibit-read-only t))
    (erase-buffer)))

It almost works exactly like Cmd-K does in Terminal.app, where it
erases the whole buffer except your current prompt and line. How would
you emulate this behavior in eshell, to erase all the buffer except
the current prompt and whatever you may have typed after it?

Thanks.

-Steven



reply via email to

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