emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master ab4e4cc: Add 'clear' functionality to eshell.


From: Vibhav Pant
Subject: [Emacs-diffs] master ab4e4cc: Add 'clear' functionality to eshell.
Date: Mon, 16 Mar 2015 18:04:40 +0000

branch: master
commit ab4e4cc92c62051983f4ee5f1bf9c82440086451
Author: Vibhav Pant <address@hidden>
Commit: Vibhav Pant <address@hidden>

    Add 'clear' functionality to eshell.
    
    * eshell/esh-mode.el (eshell/clear): New function.
    
    * etc/NEWS: Mention new built-in command.
---
 etc/NEWS                |    4 ++++
 lisp/ChangeLog          |    4 ++++
 lisp/eshell/esh-mode.el |    7 +++++++
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 75d55de..491d0d3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -556,6 +556,10 @@ to avoid interfering with the kill ring.
 allow overriding the regular expression that recognizes the ldapsearch
 command line's password prompt.
 
+** Eshell
+
+*** The new built-in command `clear' can scroll window contents out of sight.
+
 +++
 ** tar-mode: new `tar-new-entry' command, allowing for new members to
 be added to the archive.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c6fab7f..3af4bb2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-16  Vibhav Pant  <address@hidden>
+
+       * eshell/esh-mode.el (eshell/clear): New function.
+
 2015-03-16  Alan Mackenzie  <address@hidden>
 
        Make Edebug work with Follow Mode.
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



reply via email to

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