diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-13 01:17:57 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-13 01:17:57 +0100 |
commit | e85c207b39acb5ffe71810a1d96e1702f2859648 (patch) | |
tree | c16745100e9dd48b6edbe024c3b17707e23c59b8 /elisp/geiser-repl.el | |
parent | 4a3709eceb8431f514ac5b0aa3046c051ad2e41f (diff) | |
download | geiser-e85c207b39acb5ffe71810a1d96e1702f2859648.tar.gz geiser-e85c207b39acb5ffe71810a1d96e1702f2859648.tar.bz2 |
Don't bother asking if there's only one implementation.
Diffstat (limited to 'elisp/geiser-repl.el')
-rw-r--r-- | elisp/geiser-repl.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index 5a9a9fb..10a91a4 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -161,10 +161,15 @@ REPL buffer." (and (car geiser-impl--impls) (symbol-name (car geiser-impl--impls))))))) +(defsubst geiser-repl--only-impl-p () + (and (null (cdr geiser-impl--impls)) + (car geiser-impl--impls))) + (defun run-geiser (impl) "Start a new Geiser REPL." (interactive - (list (geiser-repl--read-impl "Start Geiser for scheme implementation: "))) + (list (or (geiser-repl--only-impl-p) + (geiser-repl--read-impl "Start Geiser for scheme implementation: ")))) (geiser-repl--start-repl impl)) (defun switch-to-geiser (&optional ask impl) @@ -178,7 +183,9 @@ If no REPL is running, execute `run-geiser' to start a fresh one." ((and (not ask) impl (geiser-repl--repl/impl impl))) ((= 1 (length geiser-repl--repls)) (car geiser-repl--repls)))) (impl (or impl (and (not repl) - (geiser-repl--read-impl "Switch to scheme REPL: ")))) + (or (and (not ask) + (geiser-repl--only-impl-p)) + (geiser-repl--read-impl "Switch to scheme REPL: "))))) (pop-up-windows geiser-repl-window-allow-split)) (if repl (pop-to-buffer repl) (run-geiser impl)))) |