summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2016-04-30 13:01:38 +0300
committerJose Antonio Ortega Ruiz <jao@gnu.org>2016-04-30 19:52:57 +0200
commit2b5e9c19e79e32b5cece3392dab79e0a04cbfc3f (patch)
tree2475b9a8d97ce66962952405bde201d802777d8f
parent18f71c2ef874a3b9553640b016860c222a705fdd (diff)
downloadgeiser-guile-2b5e9c19e79e32b5cece3392dab79e0a04cbfc3f.tar.gz
geiser-guile-2b5e9c19e79e32b5cece3392dab79e0a04cbfc3f.tar.bz2
Fix REPL restart if REPL is alive
-rw-r--r--elisp/geiser-repl.el21
1 files changed, 10 insertions, 11 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 46d240c..f7336f8 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -788,23 +788,22 @@ over a Unix-domain socket."
(defun switch-to-geiser (&optional ask impl buffer)
"Switch to running Geiser REPL.
+If REPL is the current buffer, switch to the previously used
+scheme buffer.
+
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))
(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)
- (not in-repl)
- impl
- (geiser-repl--repl/impl impl))))))
- (cond ((or in-live-repl
- (and (eq (current-buffer) repl) (not (eq repl buffer))))
- (when (buffer-live-p geiser-repl--last-scm-buffer)
+ (repl (unless ask
+ (if impl
+ (geiser-repl--repl/impl impl)
+ (or geiser-repl--repl (car geiser-repl--repls))))))
+ (cond (in-live-repl
+ (when (and (not (eq repl buffer))
+ (buffer-live-p geiser-repl--last-scm-buffer))
(geiser-repl--switch-to-buffer geiser-repl--last-scm-buffer)))
(repl (geiser-repl--switch-to-buffer repl))
((geiser-repl--remote-p)