summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--elisp/geiser-impl.el2
-rw-r--r--elisp/geiser-repl.el11
-rw-r--r--elisp/geiser.el2
3 files changed, 11 insertions, 4 deletions
diff --git a/elisp/geiser-impl.el b/elisp/geiser-impl.el
index eecdaa7..b50f7be 100644
--- a/elisp/geiser-impl.el
+++ b/elisp/geiser-impl.el
@@ -49,7 +49,7 @@
(add-to-list 'geiser-impl--impls impl))
(defun geiser-impl--unregister (impl)
- (remove impl geiser-impl--impls))
+ (setq geiser-impl--impls (remove impl geiser-impl--impls)))
(defvar geiser-impl--default-implementation
geiser-impl-default-implementation)
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))))
diff --git a/elisp/geiser.el b/elisp/geiser.el
index 61411dc..4c1a16e 100644
--- a/elisp/geiser.el
+++ b/elisp/geiser.el
@@ -138,8 +138,8 @@ loaded."
(buffers (and (featurep 'geiser-mode) (geiser-mode--buffers))))
(unless (file-exists-p geiser-main-file)
(error "%s does not contain Geiser!" dir))
- (remove geiser-elisp-dir load-path)
(geiser-unload)
+ (setq load-path (remove geiser-elisp-dir load-path))
(load-file geiser-main-file)
(geiser-setup)
(dolist (feature (reverse (geiser--features-list)))