From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Gregor Zattler Newsgroups: gmane.emacs.devel Subject: Re: Add function eshell/clear to clear current eshell buffer Date: Mon, 9 Mar 2015 11:11:26 +0100 Message-ID: <20150309101126.GA11863@boo.workgroup> References: <874mpwhxml.fsf@gmail.com> <83lhj7lcgn.fsf@gnu.org> <87y4n7e1bn.fsf@gmail.com> <831tkz6yh1.fsf@gnu.org> <87oao23dbb.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1425895957 26763 80.91.229.3 (9 Mar 2015 10:12:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Mar 2015 10:12:37 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 09 11:12:28 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YUufj-0003hR-Ka for ged-emacs-devel@m.gmane.org; Mon, 09 Mar 2015 11:12:27 +0100 Original-Received: from localhost ([::1]:42490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUufi-0001JR-J7 for ged-emacs-devel@m.gmane.org; Mon, 09 Mar 2015 06:12:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUufR-0001JJ-C0 for emacs-devel@gnu.org; Mon, 09 Mar 2015 06:12:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUufO-0003sB-2G for emacs-devel@gnu.org; Mon, 09 Mar 2015 06:12:09 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:55517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUufN-0003s6-OB for emacs-devel@gnu.org; Mon, 09 Mar 2015 06:12:05 -0400 Original-Received: from boo.workgroup ([87.185.173.48]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0M7pI0-1XZldS2g52-00vNbJ for ; Mon, 09 Mar 2015 11:12:02 +0100 Original-Received: from grfz by boo.workgroup with local (Exim 4.84) (envelope-from ) id 1YUufE-0004tD-Lq; Mon, 09 Mar 2015 11:11:56 +0100 Mail-Followup-To: emacs-devel Content-Disposition: inline In-Reply-To: <87oao23dbb.fsf@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:7fzKL9e8nMQUySQz1q7jiOB/QKK/j/On6/8menaaljkkFA/z7B8 XrMg2gFPnlpnQ+JZeBlTrbIVlE9xkswYJToinZA8izKKJZHsjcemxuCztojOGNdjJik4Aor wDL4OvfbDJAYgdLDYWO2fa8UuUqLLwZY47w57LPO77q2U7Vx+tYb+IXCFRWT5CD4EQ2HlFC /yQd9CmIPvH1qSsNKAS8Q== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.15.18 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183741 Archived-At: Hi Vibhav, * vibhavp@gmail.com [09. Mar. 2015]: > +(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. How about: "Scroll contents out of the eshell window by inserting newlines." (let ((number-newlines (count-lines (window-start) (point)))) (insert (make-string number-newlines ?\n))) (eshell-send-input)) > + (interactive) > + (let ((number-newlines (count-lines (window-start) (point)))) > + (insert (make-string number-newlines ?\n))) > + (eshell-send-input)) Doesn't this insert the newlines where ever the point is? Shouldn't it append the newlines to the very end of the buffer where ever point was before? Ciao; Gregor