summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-08 04:39:39 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-08 04:39:39 +0100
commit6c59e10f0e0bba91f08fbd7b5972940aae9b0cc6 (patch)
treef579067421f92bae67f3adc707b0a755f5d53b04
parent2f41f60f97936d139a5e533736f4d1d606ca46f9 (diff)
downloadgeiser-6c59e10f0e0bba91f08fbd7b5972940aae9b0cc6.tar.gz
geiser-6c59e10f0e0bba91f08fbd7b5972940aae9b0cc6.tar.bz2
Tweakings in switch-to-geiser (multiple REPLs)
-rw-r--r--elisp/geiser-repl.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index ee88005..b50f1d1 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -308,14 +308,21 @@ With prefix argument, ask for which one if more than one is running.
If no REPL is running, execute `run-geiser' to start a fresh one."
(interactive "P")
(let* ((impl (or impl geiser-impl--implementation))
- (repl (cond ((and (not ask) (not impl)
+ (in-repl (eq major-mode 'geiser-repl-mode))
+ (in-live-repl (and in-repl (get-buffer-process (current-buffer))))
+ (repl (cond ((and (not ask)
+ (not impl)
+ (not in-repl)
(or geiser-repl--repl (car geiser-repl--repls))))
- ((and (not ask) impl (geiser-repl--repl/impl impl)))))
+ ((and (not ask)
+ (not in-repl)
+ impl
+ (geiser-repl--repl/impl impl)))))
(pop-up-windows geiser-repl-window-allow-split))
- (cond ((and (eq (current-buffer) repl)
- (not (eq repl buffer))
- (buffer-live-p geiser-repl--last-scm-buffer))
- (pop-to-buffer geiser-repl--last-scm-buffer))
+ (cond ((or in-live-repl
+ (and (eq (current-buffer) repl) (not (eq repl buffer))))
+ (when (buffer-live-p geiser-repl--last-scm-buffer)
+ (pop-to-buffer geiser-repl--last-scm-buffer)))
(repl (pop-to-buffer repl))
((geiser-repl--remote-p) (geiser-connect impl))
(t (run-geiser impl)))