all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: emacs-devel@gnu.org
Subject: Re: Add function eshell/clear to clear current eshell buffer
Date: Sat, 18 Apr 2015 09:31:35 -0400	[thread overview]
Message-ID: <87d231o954.fsf@lifelogs.com> (raw)
In-Reply-To: 83vbgt7gqw.fsf@gnu.org

On Sat, 18 Apr 2015 15:39:19 +0300 Eli Zaretskii <eliz@gnu.org> wrote: 

>> From: Ted Zlatanov <tzz@lifelogs.com>
>> Date: Sat, 18 Apr 2015 07:12:22 -0400
>> 
>> >> > +(defun eshell/clear ()
>> >> > +  "Clear the eshell-buffer"
>> >> 
>> >> Now this command does not clear the eshell buffer any more, but the
>> >> eshell window.  I think the doc string should say so because this has
>> >> security implications: The user may think some info is gone but actually
>> >> it’s only no longer visible.
>> 
EZ> The same happens with a few terminal emulators, so users should
EZ> already be expecting that possibility
>> 
>> But eshell is not a terminal emulator.  It's a shell.  Emacs provides
>> the text UI around it.

EZ> I don't see the significance of this observation for the issue at
EZ> hand.  Eshell is an implementation of a shell in Emacs Lisp, and as
EZ> such, Emacs is part of it.  Therefore, we should compare what Eshell's
EZ> command do with what shells+emulators do.

I think Emacs' concepts of windows and buffers should override the
typical terminal emulators' concepts of window and scrollback buffer.
Since Emacs typically doesn't clear just the window in normal usage,
it's strange to do it here (especially by inserting blank lines).

>> I would rename `eshell/clear' to `eshell/clear-view' and also provide
>> `eshell/clear-buffer', if that's OK with Vibhav and everyone else?

EZ> Eshell should have commands named like corresponding shell commands.
EZ> Having commands with no namesakes in popular shells makes very little
EZ> sense to me.

From the man page:

      clear clears your screen if this is possible, including its
      scrollback buffer (if the extended "E3" capability is defined).
      clear looks in the environment for the terminal type and then in
      the terminfo database to determine how to clear the screen.

So, unless we come up with some E3 equivalent, I think it should be two
commands or in some other way apparent that there's two operation modes
to the `clear' eshell command.

For simplicity, how about `eshell/clear' for the window and
`eshell/clear-scrollback' for the whole buffer (also invoked with
universal-prefix on `eshell/clear')? The scrollback clear should IMO
also make sure undo is enabled, but the text is not in any registers.

Ted




  reply	other threads:[~2015-04-18 13:31 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-08  5:22 [PATCH] Add function eshell/clear to clear current eshell buffer vibhavp
2015-03-08  5:23 ` Vibhav Pant
2015-03-08  7:08   ` Bozhidar Batsov
2015-03-08  7:19     ` vibhavp
2015-03-08  7:25       ` Bozhidar Batsov
2015-03-08 15:45 ` Eli Zaretskii
2015-03-08 19:28   ` vibhavp
2015-03-08 20:11     ` Eli Zaretskii
2015-03-09  6:16       ` vibhavp
2015-03-09 10:11         ` Gregor Zattler
2015-03-09 12:33           ` vibhavp
2015-03-09 12:39             ` vibhavp
2015-03-09 15:59           ` Eli Zaretskii
2015-03-09 16:09             ` vibhavp
2015-03-09 16:43               ` Eli Zaretskii
2015-03-10  3:27                 ` Vibhav Pant
2015-03-10  7:59                   ` Bozhidar Batsov
2015-03-10  8:20                     ` Ricardo Wurmus
2015-04-18 11:12             ` Ted Zlatanov
2015-04-18 12:39               ` Eli Zaretskii
2015-04-18 13:31                 ` Ted Zlatanov [this message]
2015-04-18 13:43                   ` Eli Zaretskii
2015-04-18 14:17                     ` Ted Zlatanov
2015-04-18 15:18                     ` vibhavp
2015-04-18 15:23                       ` Eli Zaretskii
2015-04-18 19:10                         ` chad
2015-04-18 19:23                           ` Eli Zaretskii
2015-04-18 20:13                         ` vibhavp
2015-04-18 23:06                           ` Ted Zlatanov
2015-04-19  4:26                             ` vibhavp
2015-04-19 14:40                               ` Eli Zaretskii
2015-04-19 18:06                                 ` vibhavp
2015-04-19 18:24                                   ` Eli Zaretskii
2015-04-19 18:49                                     ` vibhavp
2015-04-19 18:53                                       ` Eli Zaretskii
2015-04-20 12:50                                         ` Ted Zlatanov

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=87d231o954.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=emacs-devel@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.