From a814cf43fa33f66cb2fca512084d7ac2b63ae62a Mon Sep 17 00:00:00 2001 From: Jonas Rodrigues Date: Fri, 9 Nov 2012 18:20:32 -0200 Subject: New function 'geiser-repl--clear-buffer' --- elisp/geiser-repl.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'elisp/geiser-repl.el') 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 @@ -413,6 +413,18 @@ module command as a string") (set (make-local-variable 'comint-input-filter) 'geiser-repl--input-filter) (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 @@ -588,6 +600,8 @@ buffer." (define-key geiser-repl-mode-map "\C-a" 'geiser-repl--bol) (define-key geiser-repl-mode-map (kbd "") '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)) -- cgit v1.2.3