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: Bob Newell
Subject: Re: How to really clear eshell buffer?
Date: Sat, 9 Jun 2018 14:08:34 -1000

> (defun eclear ()
>   (interactive)
>   (let ((inhibit-read-only t))
>     (delete-region (point-min) (point-at-bol)) ))

Much better in many ways. It doesn't disturb the kill-ring and limits
the scope of inhibit-read-only. Thank you. Please realize that I threw
something together in literally one minute, and I am the first to say
that I still have much to learn.

One thing I question, though ... what you have here preserves the
prompt but assumes that point is on the prompt line. This is probably
the normal case but it is not the universal case. I suppose one could
go to point-max and then back up a line, but for such an odd use case,
I wonder how much perfection is necessary.

-- 
Bob Newell
Honolulu, Hawai`i

Sent via Linux Mint 17.



reply via email to

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