summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-06-20 22:04:19 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-06-20 22:04:19 +0200
commit870d60071b8bb7d56bb3c9433b8b4b07d8206a60 (patch)
treedcf4c98f77d9fb1c2cc675c48e24af4fec9a78e1
parent54bcf1930401e3fca5e132914923efa6fe4e4b3d (diff)
downloadgeiser-chez-870d60071b8bb7d56bb3c9433b8b4b07d8206a60.tar.gz
geiser-chez-870d60071b8bb7d56bb3c9433b8b4b07d8206a60.tar.bz2
REPL improvements: bailing out earlier on startup abort; C-c z DTRT
for a running REPL.
-rw-r--r--elisp/geiser-repl.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index da7dde7..38ebc6c 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -152,8 +152,10 @@ implementation name gets appended to it."
(setq geiser-eval--default-proc-function 'geiser-repl--process)
(defun geiser-repl--wait-for-prompt (timeout)
- (let ((p (point)) (seen))
- (while (and (not seen) (> timeout 0))
+ (let ((p (point)) (seen) (buffer (current-buffer)))
+ (while (and (not seen)
+ (> timeout 0)
+ (get-buffer-process buffer))
(sleep-for 0.1)
(setq timeout (- timeout 100))
(goto-char p)
@@ -176,7 +178,8 @@ implementation name gets appended to it."
(interactive
(list (or (geiser-repl--only-impl-p)
(and (eq major-mode 'geiser-repl-mode) geiser-impl--implementation)
- (geiser-repl--read-impl "Start Geiser for scheme implementation: "))))
+ (geiser-repl--read-impl
+ "Start Geiser for scheme implementation: "))))
(geiser-repl--start-repl impl))
(defun switch-to-geiser (&optional ask impl)
@@ -292,8 +295,8 @@ If no REPL is running, execute `run-geiser' to start a fresh one."
(define-key geiser-repl-mode-map "\C-d" 'delete-char)
-(define-key geiser-repl-mode-map "\C-cz" 'run-geiser)
-(define-key geiser-repl-mode-map "\C-c\C-z" 'run-geiser)
+(define-key geiser-repl-mode-map "\C-cz" 'switch-to-geiser)
+(define-key geiser-repl-mode-map "\C-c\C-z" 'switch-to-geiser)
(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-ca" 'geiser-autodoc-mode)