[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: |
Sat, 09 Jun 2018 22:02:56 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Bob Newell wrote:
>> I want to really clear an eshell buffer,
>> which means that all former output is
>> deleted, not just scrolled away.
>
> (defun clear-eshell ()
> (interactive)
> (setq inhibit-read-only t)
> (kill-region (point-min) (point-max)))
>
> I don't see any real need to switch back to
> read-only mode.
Hit DEL and you'll see the need. (Besides it is
an unexpected side effect not evident from the
function name.)
Second, you also kill the prompt string this
way. Sure, it returns with RET, but this isn't
how one would expect clear to work. It should,
IMO, work just like in a VT with the state
unchanged WRT read-only, and with the prompt
intact, only the material removed!
Thrid, with `kill-region', the material ends up
in the kill ring. Unclear if this is intuitive
or not?
--
underground experts united
http://user.it.uu.se/~embe8573
- How to really clear eshell buffer?, Florian Lindner, 2018/06/08
- Re: How to really clear eshell buffer?, Bob Newell, 2018/06/08
- Message not available
- Re: How to really clear eshell buffer?,
Emanuel Berg <=
- Re: How to really clear eshell buffer?, Emanuel Berg, 2018/06/09
- Re: How to really clear eshell buffer?, Emanuel Berg, 2018/06/09
- Re: How to really clear eshell buffer?, Bob Newell, 2018/06/09
- Message not available
- Re: How to really clear eshell buffer?, Emanuel Berg, 2018/06/10
- Re: How to really clear eshell buffer?, Emanuel Berg, 2018/06/10