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: Colin Baxter
Subject: Re: How to really clear eshell buffer?
Date: Sat, 09 Jun 2018 07:10:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

>>>>> "Bob" == Bob Newell <bobnewell@bobnewell.net> writes:

    >> I want to really clear an eshell buffer, which means that all
    >> former
    Bob> output is deleted, not just scrolled away.

    Bob> (defun clear-eshell () (interactive) (setq inhibit-read-only t)
    Bob> (kill-region (point-min) (point-max)))

    Bob> I don't see any real need to switch back to read-only mode.

    Bob> Tie to a key if you wish and run while in the eshell buffer.
If you do, via say:

(add-hook 'eshell-mode-hook
          (lambda () (local-set-key (kbd "C-l") #'clear-eshell)))

then the eshell prompt is lost - regained if RET is entered.

Best wishes,



reply via email to

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