summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-08-13 23:03:01 +0100
committerjao <jao@gnu.org>2022-08-13 23:03:01 +0100
commit97dfdd1133a14bc6bccab804cdf286b94ad43381 (patch)
treeedd236542c93863c632f759fc1c30d163d097e16 /elisp
parent956ec5ff543e9a0fcb3b3ceb339bb1e21c39719e (diff)
downloadgeiser-97dfdd1133a14bc6bccab804cdf286b94ad43381.tar.gz
geiser-97dfdd1133a14bc6bccab804cdf286b94ad43381.tar.bz2
fix: start scheme just once if repl buffer doesn't exist
Should fix issue #49.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-mode.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el
index e0e22c6..615bbdd 100644
--- a/elisp/geiser-mode.el
+++ b/elisp/geiser-mode.el
@@ -279,12 +279,14 @@ With prefix, try to enter the current buffer's module."
(defun geiser-restart-repl ()
"Restarts the REPL associated with the current buffer."
(interactive)
- (let ((b (current-buffer)))
- (geiser-mode-switch-to-repl nil)
- (comint-kill-subjob)
- (sit-for 0.1) ;; ugly hack; but i don't care enough to fix it
- (call-interactively 'run-geiser)
- (sit-for 0.2) ;; ditto
+ (let ((b (current-buffer))
+ (impl geiser-impl--implementation))
+ (when (buffer-live-p geiser-repl--repl)
+ (geiser-mode-switch-to-repl nil)
+ (comint-kill-subjob)
+ (sit-for 0.1)) ;; ugly hack; but i don't care enough to fix it
+ (run-geiser impl)
+ (sit-for 0.2)
(goto-char (point-max))
(pop-to-buffer b)))