From: Emanuel Berg <moasen@zoho.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to really clear eshell buffer?
Date: Sat, 09 Jun 2018 22:02:56 +0200 [thread overview]
Message-ID: <867en7ybgv.fsf@zoho.com> (raw)
In-Reply-To: mailman.1526.1528480263.1292.help-gnu-emacs@gnu.org
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
next prev parent reply other threads:[~2018-06-09 20:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-08 9:13 How to really clear eshell buffer? Florian Lindner
2018-06-08 17:50 ` Bob Newell
2018-06-09 6:10 ` Colin Baxter
2018-06-09 6:27 ` Colin Baxter
[not found] ` <mailman.1526.1528480263.1292.help-gnu-emacs@gnu.org>
2018-06-09 20:02 ` Emanuel Berg [this message]
2018-06-09 20:58 ` Emanuel Berg
2018-06-09 21:39 ` Emanuel Berg
2018-06-10 0:08 ` Bob Newell
[not found] ` <mailman.1611.1528589338.1292.help-gnu-emacs@gnu.org>
2018-06-10 11:19 ` Emanuel Berg
2018-06-10 14:08 ` Emanuel Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=867en7ybgv.fsf@zoho.com \
--to=moasen@zoho.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).