[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clearing eshell screen

From: Oscar Fuentes
Subject: Re: Clearing eshell screen
Date: 25 Oct 2002 01:59:17 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Oscar Fuentes <> writes:

> For me (Emacs 21.1.1 on Win2k and Linux) eshell doesn't
> honor the eshell-buffer-maximum-lines variable either

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

(defun eshell-clears-buffer ()
  "Deletes the contents of eshell buffer, except the last prompt"
    (goto-char eshell-last-output-end)
    (let ((lines (count-lines 1 (point)))
          (inhibit-read-only t))
      (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")))))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]