From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oscar Fuentes Newsgroups: gmane.emacs.help Subject: Re: Clearing eshell screen Date: 25 Oct 2002 01:59:17 +0200 Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: <3DB87FBD.4090707@ihs.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035504286 26662 80.91.224.249 (25 Oct 2002 00:04:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 25 Oct 2002 00:04:46 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 184ry0-0006vs-00 for ; Fri, 25 Oct 2002 02:04:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 184rul-0001V1-00; Thu, 24 Oct 2002 20:01:23 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!234-coru-x7.libre.retevision.ES!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 234-coru-x7.libre.retevision.es (62.83.54.234) Original-X-Trace: fu-berlin.de 1035503934 29627868 62.83.54.234 (16 [33817]) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Original-Xref: shelby.stanford.edu gnu.emacs.help:106361 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2911 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2911 Oscar Fuentes writes: [snip] > For me (Emacs 21.1.1 on Win2k and Linux) eshell doesn't > honor the eshell-buffer-maximum-lines variable either [snip] Ooops! As the documentation says, adding 'eshell-truncate-buffer' to 'eshell-output-filter-functions' does the trick. Sorry. Maybe this modification of 'eshell-truncate-buffer' is useful for the OP: (defun eshell-clears-buffer () "Deletes the contents of eshell buffer, except the last prompt" (interactive) (save-excursion (goto-char eshell-last-output-end) (let ((lines (count-lines 1 (point))) (inhibit-read-only t)) (beginning-of-line) (let ((pos (point))) (if (bobp) (if (interactive-p) (error "Buffer too short to truncate")) (delete-region (point-min) (point)) (if (interactive-p) (message "Buffer cleared"))))))) -- Oscar