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

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

Re: How to really clear eshell buffer?


From: Emanuel Berg
Subject: Re: How to really clear eshell buffer?
Date: Sun, 10 Jun 2018 16:08:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

> Perhaps too arbitrary BTW - perhaps one should
> add a guard that confirms that the mode is
> EShell, because otherwise one could get used
> to it (to invoke it like any command, not type
> "ecelar" and hit RET) and then by mistake
> "clear" some other useful buffer that way.

(defun eclear ()
  (interactive)
  (when (eq major-mode 'eshell-mode)
    (goto-char (point-max))
    (let ((inhibit-read-only t))
      (delete-region (point-min) (point-at-bol)) )))

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

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