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:27:39 +0100 Message-ID: <874lic4gpw.fsf@yandex.com> References: <39643308-1912-7c8c-88b8-e777f1b5230c@xgm.de> <87d0x04hht.fsf@yandex.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1528525573 8853 195.159.176.226 (9 Jun 2018 06:26:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 9 Jun 2018 06:26:13 +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:26:09 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 1fRXKC-00029X-2H for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Jun 2018 08:26:08 +0200 Original-Received: from localhost ([::1]:39196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRXMH-0001DR-8X for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Jun 2018 02:28:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRXLm-0001D9-6f for help-gnu-emacs@gnu.org; Sat, 09 Jun 2018 02:27:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRXLl-0006eO-BK for help-gnu-emacs@gnu.org; Sat, 09 Jun 2018 02:27:46 -0400 Original-Received: from forward106o.mail.yandex.net ([2a02:6b8:0:1a2d::609]:57137) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRXLk-0006d3-VO for help-gnu-emacs@gnu.org; Sat, 09 Jun 2018 02:27:45 -0400 Original-Received: from mxback10j.mail.yandex.net (mxback10j.mail.yandex.net [IPv6:2a02:6b8:0:1619::113]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 0A363784D5B; Sat, 9 Jun 2018 09:27:42 +0300 (MSK) Original-Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback10j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id hChf2A22Qa-RfgqKHFG; Sat, 09 Jun 2018 09:27:41 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1528525662; bh=k5J6zv19l/lZkRU8zYNlyGCzMVaFdQ6CdsFlDKPgCUo=; h=From:To:Cc:Cc:Subject:References:Date:In-Reply-To:Message-ID; b=UeWow9nRxXq+/yhUpe7tRb7/69EgG2v9I65t3OJ/1Bw7bD3MwUJs6BREX/7exTFDb iKPH1ZDJUpbUnRYIUTn4EwCi+KawTGoHpXMwmZns2L53njNZD49h8GHCERd685dzZ7 /K17eJzNMhaFolDzIuQxKNfF2x7l0EEB/BZGStmc= Original-Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rQpf4BLmmg-ReWW4ssU; Sat, 09 Jun 2018 09:27:40 +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=1528525660; bh=k5J6zv19l/lZkRU8zYNlyGCzMVaFdQ6CdsFlDKPgCUo=; h=From:To:Cc:Cc:Subject:References:Date:In-Reply-To:Message-ID; b=uvi4iCCRXX0rPi8EcxbKzzAt42T1YgUiSXUrys7W7zlgqikmPfdCs6EWp/429K3p+ JB+pmDNaWJ2JF26FVDSe3JDGIBn8NnrP/0G/4N8/a0zrvv7AAQdX+H0ivSEWtAFOhb SR4FWe0bepEU6qNj1QpU3CXVoEBz6PnJrLIcmwuE= Authentication-Results: smtp2o.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: <87d0x04hht.fsf@yandex.com> (Colin Baxter's message of "Sat, 09 Jun 2018 07:10:54 +0100") Face: iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAIAAAC0tAIdAAAABmJLR0QA/wD/AP+gvaeTAAAA fUlEQVQokc2SMQqAMAxFX7yFnq6IuAjetFcQF40H6B4XodYqKjgYsgQen5cQMeN5FS/YD2hVvEf1 DDeLHQJNgwiACG1LCAmQDM4ds+r6gp6mLXVfIixLZKL3OJJf04xhOPN+kp1odd2R7vvrLW9vIrmr KvNMVVGWmdhv/mQFS9GDojbghEYAAAAASUVORK5CYII= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a02:6b8:0:1a2d::609 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:117061 Archived-At: >>>>> "Colin" == Colin Baxter writes: >>>>> "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. Colin> If you do, via say: Colin> (add-hook 'eshell-mode-hook (lambda () (local-set-key (kbd Colin> "C-l") #'clear-eshell))) Colin> then the eshell prompt is lost - regained if RET is entered. Just need to add (eshell-send-input) to the defun. Sorry about the noise. Best wishes,