From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: vibhavp@gmail.com
Newsgroups: gmane.emacs.devel
Subject: Re: Add function eshell/clear to clear current eshell buffer
Date: Sun, 19 Apr 2015 01:43:49 +0530
Message-ID: <87fv7xi48y.fsf@gmail.com>
References: <874mpwhxml.fsf@gmail.com> <83lhj7lcgn.fsf@gnu.org>
	<87y4n7e1bn.fsf@gmail.com> <831tkz6yh1.fsf@gnu.org>
	<87oao23dbb.fsf@gmail.com> <20150309101126.GA11863@boo.workgroup>
	<83twxu5fh5.fsf@gnu.org> <87y4lpofl5.fsf@lifelogs.com>
	<83vbgt7gqw.fsf@gnu.org> <87d231o954.fsf@lifelogs.com>
	<83r3rh7dsb.fsf@gnu.org> <87mw25sbvx.fsf@gmail.com>
	<83lhhp795h.fsf@gnu.org>
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Trace: ger.gmane.org 1429388044 22737 80.91.229.3 (18 Apr 2015 20:14:04 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 18 Apr 2015 20:14:04 +0000 (UTC)
Cc: emacs-devel@gnu.org
To: Eli Zaretskii <eliz@gnu.org>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 18 22:14:03 2015
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>
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 <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>)
	id 1YjZ7q-00043g-Vx
	for ged-emacs-devel@m.gmane.org; Sat, 18 Apr 2015 22:14:03 +0200
Original-Received: from localhost ([::1]:46735 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>)
	id 1YjZ7p-0007Gg-PY
	for ged-emacs-devel@m.gmane.org; Sat, 18 Apr 2015 16:14:01 -0400
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58944)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vibhavp@gmail.com>) id 1YjZ7m-0007Gb-5J
	for emacs-devel@gnu.org; Sat, 18 Apr 2015 16:13:59 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vibhavp@gmail.com>) id 1YjZ7i-0003Dn-WF
	for emacs-devel@gnu.org; Sat, 18 Apr 2015 16:13:58 -0400
Original-Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]:35664)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vibhavp@gmail.com>)
	id 1YjZ7i-0003DZ-OU; Sat, 18 Apr 2015 16:13:54 -0400
Original-Received: by pabtp1 with SMTP id tp1so162352248pab.2;
	Sat, 18 Apr 2015 13:13:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:references:date:in-reply-to:message-id
	:user-agent:mime-version:content-type;
	bh=IM1Ka1N1FBUKKYKqiNbY2gsQAX6WrUh9dTPOWhDgPmA=;
	b=eFG/2sgZpGgsE5NHV66Ghtlw9E0iNSPPl33uxoIXsSDYwSpdrJsEgHex6mMJxaOtG7
	Y8OPoNFypMCUuA6ckek/h6dVyUo/2yhd3/jTfT8uzk4E7bdlzUqhyUo8H/rVJEygrywJ
	rJ1iXOAkmTsVnMBt26rH/vXmc6hiRsJwitVlxvnpiC2OBiRNE5jZstI4q+PGc0gkn7AR
	Jh7I16Ne2o/I74iEwjC5WpIVTrAwL4z9UQNx69yaQV0uTE5cxR3zJXqrin8NS1Yf92FQ
	N67zl3sKxCiQgkznY0mQDNJAvHQupfyUITJw8s08BksCb1fEF3Q71iP/86p0SE6XNvZP
	+yzA==
X-Received: by 10.68.161.4 with SMTP id xo4mr15923814pbb.65.1429388033571;
	Sat, 18 Apr 2015 13:13:53 -0700 (PDT)
Original-Received: from lenovog410 ([117.214.173.142]) by mx.google.com with ESMTPSA id
	cj2sm13695390pbb.10.2015.04.18.13.13.51
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sat, 18 Apr 2015 13:13:52 -0700 (PDT)
In-Reply-To: <83lhhp795h.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 18 Apr
	2015 18:23:22 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
	(bad octet value).
X-Received-From: 2607:f8b0:400e:c03::235
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=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:185636
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/185636>

--=-=-=
Content-Type: text/plain

Attached a patch which adds a clear-scrollback command to eshell. If it
looks good, I'll push the patch to master with the relevant info in
etc/NEWS.

--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=esh-clear-scrollback.patch

diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 15120cb..21026b2 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -878,6 +878,12 @@ When run interactively, widen the buffer first."
     (insert (make-string number-newlines ?\n)))
     (eshell-send-input))
 
+(defun eshell/clear-scrollback ()
+    "Clear the scrollback content of the eshell window."
+  (interactive)
+  (let ((inhibit-read-only t))
+    (erase-buffer)))
+
 (defun eshell-get-old-input (&optional use-current-region)
   "Return the command input on the current line."
   (if use-current-region

--=-=-=
Content-Type: text/plain


-- 
Vibhav Pant
vibhavp@gmail.com

--=-=-=--