summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2023-02-28 03:45:39 +0000
committerjao <jao@gnu.org>2023-02-28 03:45:39 +0000
commitbd12f2dc6c5949e260f094fb60737498cd0ae9a5 (patch)
tree78df3ff3f12d2042cead3d6e76b4b65530887699 /elisp
parent7c2fd938c607c88ffbf848bfa58181378c29055a (diff)
downloadgeiser-bd12f2dc6c5949e260f094fb60737498cd0ae9a5.tar.gz
geiser-bd12f2dc6c5949e260f094fb60737498cd0ae9a5.tar.bz2
Look for existing REPLs when compiling for the first time
Should provide a better fix for extended issue #58.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-compile.el2
-rw-r--r--elisp/geiser-repl.el9
2 files changed, 7 insertions, 4 deletions
diff --git a/elisp/geiser-compile.el b/elisp/geiser-compile.el
index 1f80e97..3897499 100644
--- a/elisp/geiser-compile.el
+++ b/elisp/geiser-compile.el
@@ -47,7 +47,7 @@
(defun geiser-compile--ensure-repl (force)
(when (or force
- (and (not (geiser-repl--repl-buffer-p))
+ (and (not (geiser-repl--ensure-repl-buffer))
(yes-or-no-p "No REPL is running: start it?")))
(geiser-repl-restart-repl)))
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index b248a88..57c4673 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -1085,15 +1085,18 @@ If no REPL is running, execute `geiser' to start a fresh one."
(geiser-repl-switch-to-module (geiser-eval--get-module) (current-buffer))
(geiser-repl-switch nil nil (current-buffer))))
-(defun geiser-repl--repl-buffer-p ()
- (and (buffer-live-p geiser-repl--repl) geiser-repl--repl))
+(defun geiser-repl--ensure-repl-buffer ()
+ (unless (buffer-live-p geiser-repl--repl)
+ (setq geiser-repl--repl
+ (geiser-repl--repl/impl geiser-impl--implementation)))
+ (buffer-live-p geiser-repl--repl))
(defun geiser-repl-restart-repl ()
"Restarts the REPL associated with the current buffer."
(interactive)
(let ((b (current-buffer))
(impl geiser-impl--implementation))
- (when (geiser-repl--repl-buffer-p)
+ (when (buffer-live-p geiser-repl--repl)
(geiser-repl--switch-to-repl nil)
(comint-kill-subjob)
(sit-for 0.1)) ;; ugly hack; but i don't care enough to fix it