summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Rodrigues <jxonas@gmail.com>2012-11-09 18:20:32 -0200
committerJonas Rodrigues <jxonas@gmail.com>2012-11-09 18:20:32 -0200
commita814cf43fa33f66cb2fca512084d7ac2b63ae62a (patch)
tree9798bd18ba1281b70f1ba650dde35082ba48be9f
parentf5144a27494a1e83d658d400289ba104b050ffd3 (diff)
downloadgeiser-chez-a814cf43fa33f66cb2fca512084d7ac2b63ae62a.tar.gz
geiser-chez-a814cf43fa33f66cb2fca512084d7ac2b63ae62a.tar.bz2
New function 'geiser-repl--clear-buffer'
-rw-r--r--elisp/geiser-repl.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index d7be7cf..fd87d42 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -414,6 +414,18 @@ module command as a string")
(geiser-repl--read-input-ring))
+;;; Cleaning up
+
+(defun geiser-repl--clear-buffer ()
+ "Delete the output generated by the scheme process."
+ (interactive)
+ (let ((inhibit-read-only t))
+ (delete-region (point-min) (geiser-repl--last-prompt-start))
+ (when (< (point) (geiser-repl--last-prompt-end))
+ (goto-char (geiser-repl--last-prompt-end)))
+ (recenter t)))
+
+
;;; Cleaning up on quit
(defun geiser-repl--on-quit ()
@@ -588,6 +600,8 @@ buffer."
(define-key geiser-repl-mode-map "\C-a" 'geiser-repl--bol)
(define-key geiser-repl-mode-map (kbd "<home>") 'geiser-repl--bol)
+(define-key geiser-repl-mode-map "\C-c\M-o" 'geiser-repl--clear-buffer)
+
(geiser-menu--defmenu repl geiser-repl-mode-map
("Complete symbol" ((kbd "M-TAB"))
completion-at-point :enable (geiser--symbol-at-point))