all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bob Newell <bobnewell@bobnewell.net>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to really clear eshell buffer?
Date: Sat, 9 Jun 2018 14:08:34 -1000	[thread overview]
Message-ID: <CADoYgq-Lv_uA7OsMkp_2B4PvqSNL_J7n0oXq1c4LTSOweMYkhQ@mail.gmail.com> (raw)
In-Reply-To: <86zi03wucg.fsf@zoho.com>

> (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.



  parent reply	other threads:[~2018-06-10  0:08 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
2018-06-09 20:58     ` Emanuel Berg
2018-06-09 21:39       ` Emanuel Berg
2018-06-10  0:08       ` Bob Newell [this message]
     [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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADoYgq-Lv_uA7OsMkp_2B4PvqSNL_J7n0oXq1c4LTSOweMYkhQ@mail.gmail.com \
    --to=bobnewell@bobnewell.net \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.