diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-08 04:39:39 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-08 04:39:39 +0100 |
commit | 73451229ea7f9ba26199851bc19aafabde900e78 (patch) | |
tree | 423764c24226adcd2d82342f217208ff6486018b /elisp/geiser-repl.el | |
parent | 39d0ccb19d7c390f306374987219b1d599902bdc (diff) | |
download | geiser-guile-73451229ea7f9ba26199851bc19aafabde900e78.tar.gz geiser-guile-73451229ea7f9ba26199851bc19aafabde900e78.tar.bz2 |
Tweakings in switch-to-geiser (multiple REPLs)
Diffstat (limited to 'elisp/geiser-repl.el')
-rw-r--r-- | elisp/geiser-repl.el | 19 |
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))) |