[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add function eshell/clear to clear current eshell buffer
From: |
vibhavp |
Subject: |
Re: Add function eshell/clear to clear current eshell buffer |
Date: |
Mon, 09 Mar 2015 21:39:22 +0530 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
> Scroll contents of eshell window out of sight, leaving a blank window.
Here you go.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d8330a4..efb160c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-09 Vibhav Pant <address@hidden>
+
+ * eshell/esh-mode.el (eshell/clear): New function.
+
2015-03-09 Nicolas Petton <address@hidden>
* emacs-lisp/seq.el (seq-into): New function.
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index da83ec6..15120cb 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -871,6 +871,13 @@ When run interactively, widen the buffer first."
(goto-char (point-max))
(recenter -1))
+(defun eshell/clear ()
+ "Scroll contents of eshell window out of sight, leaving a blank window."
+ (interactive)
+ (let ((number-newlines (count-lines (window-start) (point))))
+ (insert (make-string number-newlines ?\n)))
+ (eshell-send-input))
+
(defun eshell-get-old-input (&optional use-current-region)
"Return the command input on the current line."
(if use-current-region
--
Vibhav Pant
address@hidden
- Re: [PATCH] Add function eshell/clear to clear current eshell buffer, (continued)
Re: [PATCH] Add function eshell/clear to clear current eshell buffer, Eli Zaretskii, 2015/03/08
- Re: [PATCH] Add function eshell/clear to clear current eshell buffer, vibhavp, 2015/03/08
- Re: [PATCH] Add function eshell/clear to clear current eshell buffer, Eli Zaretskii, 2015/03/08
- Re: [PATCH] Add function eshell/clear to clear current eshell buffer, vibhavp, 2015/03/09
- Re: Add function eshell/clear to clear current eshell buffer, Gregor Zattler, 2015/03/09
- Re: Add function eshell/clear to clear current eshell buffer, vibhavp, 2015/03/09
- Re: Add function eshell/clear to clear current eshell buffer, vibhavp, 2015/03/09
- Re: Add function eshell/clear to clear current eshell buffer, Eli Zaretskii, 2015/03/09
- Re: Add function eshell/clear to clear current eshell buffer,
vibhavp <=
- Re: Add function eshell/clear to clear current eshell buffer, Eli Zaretskii, 2015/03/09
- Re: Add function eshell/clear to clear current eshell buffer, Vibhav Pant, 2015/03/09
- Re: Add function eshell/clear to clear current eshell buffer, Bozhidar Batsov, 2015/03/10
- Re: Add function eshell/clear to clear current eshell buffer, Ricardo Wurmus, 2015/03/10