From fd87a78cd54874a7f8260cdae11868d6ab718f09 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 7 Mar 2010 23:43:50 +0100 Subject: Better prompt behaviour in switch to REPL and module. --- elisp/geiser-repl.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'elisp') diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index 7c0994b..9e66901 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -239,8 +239,14 @@ module command as a string") (switch-to-geiser) (when (and m (eq major-mode 'geiser-repl-mode)) (goto-char (point-max)) - (insert m) - (comint-send-input)))) + (let ((b (or (and comint-last-prompt-overlay + (overlay-start comint-last-prompt-overlay)) + (point)))) + (insert m) + (let ((e (point)) + (comint-input-filter (lambda (x) nil))) + (comint-send-input nil t) + (comint-kill-region b (1+ e))))))) (defun geiser-repl-nuke () "Try this command if the REPL becomes unresponsive." -- cgit v1.2.3