aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVibhav Pant2015-03-17 05:01:59 +0530
committerVibhav Pant2015-03-17 05:01:59 +0530
commitab4e4cc92c62051983f4ee5f1bf9c82440086451 (patch)
tree6437b8243bbb4b74a9748fde80d86cd540f65f0c
parent3eb4d23a7cdee6f763b5be4947f70a1040c25424 (diff)
downloademacs-ab4e4cc92c62051983f4ee5f1bf9c82440086451.tar.gz
emacs-ab4e4cc92c62051983f4ee5f1bf9c82440086451.zip
Add 'clear' functionality to eshell.
* eshell/esh-mode.el (eshell/clear): New function. * etc/NEWS: Mention new built-in command.
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/eshell/esh-mode.el7
3 files changed, 15 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 75d55de3f36..491d0d3de54 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -556,6 +556,10 @@ to avoid interfering with the kill ring.
556allow overriding the regular expression that recognizes the ldapsearch 556allow overriding the regular expression that recognizes the ldapsearch
557command line's password prompt. 557command line's password prompt.
558 558
559** Eshell
560
561*** The new built-in command `clear' can scroll window contents out of sight.
562
559+++ 563+++
560** tar-mode: new `tar-new-entry' command, allowing for new members to 564** tar-mode: new `tar-new-entry' command, allowing for new members to
561be added to the archive. 565be added to the archive.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c6fab7fba3d..3af4bb20b04 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12015-03-16 Vibhav Pant <vibhavp@gmail.com>
2
3 * eshell/esh-mode.el (eshell/clear): New function.
4
12015-03-16 Alan Mackenzie <acm@muc.de> 52015-03-16 Alan Mackenzie <acm@muc.de>
2 6
3 Make Edebug work with Follow Mode. 7 Make Edebug work with Follow Mode.
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index da83ec6a6ab..15120cb61d4 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -871,6 +871,13 @@ When run interactively, widen the buffer first."
871 (goto-char (point-max)) 871 (goto-char (point-max))
872 (recenter -1)) 872 (recenter -1))
873 873
874(defun eshell/clear ()
875 "Scroll contents of eshell window out of sight, leaving a blank window."
876 (interactive)
877 (let ((number-newlines (count-lines (window-start) (point))))
878 (insert (make-string number-newlines ?\n)))
879 (eshell-send-input))
880
874(defun eshell-get-old-input (&optional use-current-region) 881(defun eshell-get-old-input (&optional use-current-region)
875 "Return the command input on the current line." 882 "Return the command input on the current line."
876 (if use-current-region 883 (if use-current-region