all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Add function eshell/clear to clear current eshell buffer
@ 2015-03-08  5:22 vibhavp
  2015-03-08  5:23 ` Vibhav Pant
  2015-03-08 15:45 ` Eli Zaretskii
  0 siblings, 2 replies; 36+ messages in thread
From: vibhavp @ 2015-03-08  5:22 UTC (permalink / raw
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 243 bytes --]

Hello,
Eshell currently lacks a "clear" command. Since it cannot use the one
provided by the ncurses package, I added a patch which adds similar
functionality to eshell. It can be called by simply typing "clear" on
the eshell prompt.

Thanks


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: eshell-clear patch --]
[-- Type: text/x-diff, Size: 938 bytes --]

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0b277c7..409ca23 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-08  Vibhav Pant  <vibhavp@gmail.com>
+
+	* eshell/esh-mode.el (eshell/clear): New function.
+
 2015-03-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* battery.el (battery-echo-area-format): Simplify default.
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index da83ec6..a1c71cc 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -902,6 +902,12 @@ When run interactively, widen the buffer first."
       (bury-buffer)
     (kill-buffer (current-buffer))))
 
+(defun eshell/clear ()
+  "Clear the eshell buffer."
+  (let ((inhibit-read-only t))
+    (erase-buffer)
+    (eshell-send-input)))
+
 (defun eshell-truncate-buffer ()
   "Truncate the buffer to `eshell-buffer-maximum-lines'.
 This function could be on `eshell-output-filter-functions' or bound to

[-- Attachment #3: Type: text/plain, Size: 34 bytes --]

-- 
Vibhav Pant
vibhavp@gmail.com

^ permalink raw reply related	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2015-04-20 12:50 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-08  5:22 [PATCH] Add function eshell/clear to clear current eshell buffer vibhavp
2015-03-08  5:23 ` Vibhav Pant
2015-03-08  7:08   ` Bozhidar Batsov
2015-03-08  7:19     ` vibhavp
2015-03-08  7:25       ` Bozhidar Batsov
2015-03-08 15:45 ` Eli Zaretskii
2015-03-08 19:28   ` vibhavp
2015-03-08 20:11     ` Eli Zaretskii
2015-03-09  6:16       ` vibhavp
2015-03-09 10:11         ` Gregor Zattler
2015-03-09 12:33           ` vibhavp
2015-03-09 12:39             ` vibhavp
2015-03-09 15:59           ` Eli Zaretskii
2015-03-09 16:09             ` vibhavp
2015-03-09 16:43               ` Eli Zaretskii
2015-03-10  3:27                 ` Vibhav Pant
2015-03-10  7:59                   ` Bozhidar Batsov
2015-03-10  8:20                     ` Ricardo Wurmus
2015-04-18 11:12             ` Ted Zlatanov
2015-04-18 12:39               ` Eli Zaretskii
2015-04-18 13:31                 ` Ted Zlatanov
2015-04-18 13:43                   ` Eli Zaretskii
2015-04-18 14:17                     ` Ted Zlatanov
2015-04-18 15:18                     ` vibhavp
2015-04-18 15:23                       ` Eli Zaretskii
2015-04-18 19:10                         ` chad
2015-04-18 19:23                           ` Eli Zaretskii
2015-04-18 20:13                         ` vibhavp
2015-04-18 23:06                           ` Ted Zlatanov
2015-04-19  4:26                             ` vibhavp
2015-04-19 14:40                               ` Eli Zaretskii
2015-04-19 18:06                                 ` vibhavp
2015-04-19 18:24                                   ` Eli Zaretskii
2015-04-19 18:49                                     ` vibhavp
2015-04-19 18:53                                       ` Eli Zaretskii
2015-04-20 12:50                                         ` Ted Zlatanov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.