summaryrefslogtreecommitdiff
path: root/elisp
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
commit155d0fa74984a230ec7056669d12ea3e1ff3917f (patch)
tree23c626404706fa24d2bb58fb8813952d59a0cb2b /elisp
parent146537233f7fa7d8de1746969c1217b5eaac53d1 (diff)
downloadgeiser-155d0fa74984a230ec7056669d12ea3e1ff3917f.tar.gz
geiser-155d0fa74984a230ec7056669d12ea3e1ff3917f.tar.bz2
Fix REPL restart if REPL is alive
Diffstat (limited to 'elisp')
-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)