emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master eaf9499: Add new interactive command comint-clear-b


From: Bozhidar Batsov
Subject: [Emacs-diffs] master eaf9499: Add new interactive command comint-clear-buffer
Date: Tue, 24 Feb 2015 06:54:54 +0000

branch: master
commit eaf9499a7fe485a57ab54c665f0548d4eb1a2e88
Author: Bozhidar Batsov <address@hidden>
Commit: Bozhidar Batsov <address@hidden>

    Add new interactive command comint-clear-buffer
    
    The command clears the entire comint buffer. It's bound to C-c M-o.
---
 lisp/ChangeLog |    5 +++++
 lisp/comint.el |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d401852..7e7bbb7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-24  Bozhidar Batsov  <address@hidden>
+
+       * comint.el (comint-clear-buffer): New command.
+       (comint-mode-map): Bind `comint-clear-buffer' to 'C-c M-o'.
+
 2015-02-23  Pete Williamson  <address@hidden>  (tiny change)
 
        Use ${EXEEXT} more uniformly in makefiles
diff --git a/lisp/comint.el b/lisp/comint.el
index 30c4dda..30aece1 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -472,6 +472,7 @@ executed once when the buffer is created."
     (define-key map "\C-c\C-\\"   'comint-quit-subjob)
     (define-key map "\C-c\C-m"           'comint-copy-old-input)
     (define-key map "\C-c\C-o"           'comint-delete-output)
+    (defile-key map "\C-c\M-o"    'comint-clear-buffer)
     (define-key map "\C-c\C-r"           'comint-show-output)
     (define-key map "\C-c\C-e"           'comint-show-maximum-output)
     (define-key map "\C-c\C-l"           'comint-dynamic-list-input-ring)
@@ -2428,6 +2429,11 @@ Sets mark to the value of point when this command is 
run."
           (goto-char (field-beginning pos))
           (set-window-start (selected-window) (point))))))
 
+(defun comint-clear-buffer ()
+  "Clear the comint buffer."
+  (interactive)
+  (let ((comint-buffer-maximum-size 0))
+    (comint-truncate-buffer)))
 
 (defun comint-interrupt-subjob ()
   "Interrupt the current subjob.



reply via email to

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