diff options
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-compile.el | 2 | ||||
-rw-r--r-- | elisp/geiser-repl.el | 9 |
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 |