From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Colin Baxter Newsgroups: gmane.emacs.help Subject: Re: How to really clear eshell buffer? Date: Sat, 09 Jun 2018 07:10:54 +0100 Message-ID: <87d0x04hht.fsf@yandex.com> References: <39643308-1912-7c8c-88b8-e777f1b5230c@xgm.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1528524572 9782 195.159.176.226 (9 Jun 2018 06:09:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 9 Jun 2018 06:09:32 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: , help-gnu-emacs@gnu.org To: Bob Newell Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 09 08:09:27 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fRX42-0002Og-E4 for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Jun 2018 08:09:26 +0200 Original-Received: from localhost ([::1]:39161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRX67-0006mT-Jp for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Jun 2018 02:11:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRX5Y-0006kD-NG for help-gnu-emacs@gnu.org; Sat, 09 Jun 2018 02:11:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRX5X-0000gX-RS for help-gnu-emacs@gnu.org; Sat, 09 Jun 2018 02:11:00 -0400 Original-Received: from forward102j.mail.yandex.net ([2a02:6b8:0:801:2::102]:40141) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRX5X-0000fI-Ed for help-gnu-emacs@gnu.org; Sat, 09 Jun 2018 02:10:59 -0400 Original-Received: from mxback3o.mail.yandex.net (mxback3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1d]) by forward102j.mail.yandex.net (Yandex) with ESMTP id A187D56018F9; Sat, 9 Jun 2018 09:10:56 +0300 (MSK) Original-Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback3o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nM1umtCZSk-Au2SUBII; Sat, 09 Jun 2018 09:10:56 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1528524656; bh=Rw3V1HHWGtQVZ7DFGiTWAS2Esk7dGfVoz1tIGIA1VRE=; h=From:To:Cc:Cc:Subject:References:Date:In-Reply-To:Message-ID; b=xts1grqRHLxjBDVqpAphMcLOmxjEVfsj/RB+nBjgvceYyfXwJuebeKnu/+w4FHn2d DVHNzKD7jzGgUcU9Owndy/6HhubDjZlT0ZDntOM9yreB+i2rvYbVz8KZC8iE8GCs1I +EA2ijziOETyR5F4WnNQ15zmQxmD5jJbpRGtP0lY= Original-Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id TD0O0iwCAo-AtDGkJP4; Sat, 09 Jun 2018 09:10:55 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1528524655; bh=Rw3V1HHWGtQVZ7DFGiTWAS2Esk7dGfVoz1tIGIA1VRE=; h=From:To:Cc:Cc:Subject:References:Date:In-Reply-To:Message-ID; b=aSEhuPIVicfQz7FWErtwtzJ0Yklmn/Gp9jZD9wecsBfYGRe6QkBzUgMqw2r9W68vx cWsbTp1fG1LM7drUuTNypOO/KmvorwTFJd55xOccJbC5hnKQm5iI18wiW5YXmLm/FZ W0EZun/su9sQYopkcZ9xSgOW/c0eMCPFdfTXx9mQ= Authentication-Results: smtp4o.mail.yandex.net; dkim=pass header.i=@yandex.com X-Face: -P+89ASh_wrs;AUGm`!l[}/o-lyK}5W.gq\fkJ{#d6Gu,hWrZNz::iMm5PJb} __A96]-LUrl)X=uF=V|\3-\9/sXvBs/H In-Reply-To: (Bob Newell's message of "Fri, 8 Jun 2018 07:50:39 -1000") Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAMCAIAAACfoWgaAAAABmJLR0QA/wD/AP+gvaeTAAAA X0lEQVQ4jWN8c8aEAQN8/sFqXF2AKc7M9Od6dz/l6hkYGJiwitIBsPz+9RNT9M+vf//+fsMUZ2L4 SxX1DAPpY1Y2diyi/1iZmLkwxRmZ/lBFPcNoHNMRjMYxBAznOAYA5CdahAWNqpUAAAAASUVORK5C YII= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a02:6b8:0:801:2::102 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117060 Archived-At: >>>>> "Bob" == Bob Newell writes: >> I want to really clear an eshell buffer, which means that all >> former Bob> output is deleted, not just scrolled away. Bob> (defun clear-eshell () (interactive) (setq inhibit-read-only t) Bob> (kill-region (point-min) (point-max))) Bob> I don't see any real need to switch back to read-only mode. Bob> Tie to a key if you wish and run while in the eshell buffer. If you do, via say: (add-hook 'eshell-mode-hook (lambda () (local-set-key (kbd "C-l") #'clear-eshell))) then the eshell prompt is lost - regained if RET is entered. Best wishes,