diff options
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-mode.el | 1 | ||||
-rw-r--r-- | elisp/geiser-repl.el | 19 |
2 files changed, 9 insertions, 11 deletions
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el index ff50a10..7004004 100644 --- a/elisp/geiser-mode.el +++ b/elisp/geiser-mode.el @@ -235,7 +235,6 @@ interacting with the Geiser REPL is at your disposal. ("Switch to REPL and enter module" "\C-c\C-Z" geiser-mode-switch-to-repl-and-enter) ("Set Scheme..." "\C-c\C-s" geiser-set-scheme) - ;; ("Load buffer" "\C-l" geiser-compile-current-buffer) -- ("Edit symbol at point" "\M-." geiser-edit-symbol-at-point :enable (symbol-at-point)) diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index 37572d0..9e36fa4 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -88,12 +88,13 @@ implementation name gets appended to it." (make-variable-buffer-local (defvar geiser-repl--repl nil)) -(defsubst geiser-repl--this-buffer-repl () - geiser-repl--repl) - (defsubst geiser-repl--set-this-buffer-repl (r) (setq geiser-repl--repl r)) +(defun geiser-repl--live-p () + (and geiser-repl--repl + (get-buffer-process geiser-repl--repl))) + (defun geiser-repl--repl/impl (impl &optional repls) (catch 'repl (dolist (repl (or repls geiser-repl--repls)) @@ -232,8 +233,7 @@ If no REPL is running, execute `run-geiser' to start a fresh one." (interactive "P") (let* ((impl (or impl geiser-impl--implementation)) (repl (cond ((and (not ask) (not impl) - (or (geiser-repl--this-buffer-repl) - (car geiser-repl--repls)))) + (or geiser-repl--repl (car geiser-repl--repls)))) ((and (not ask) impl (geiser-repl--repl/impl impl))))) (pop-up-windows geiser-repl-window-allow-split)) (cond ((and (eq (current-buffer) repl) @@ -315,7 +315,7 @@ module command as a string") (when (buffer-live-p buffer) (with-current-buffer buffer (when (and (eq geiser-impl--implementation impl) - (equal cb (geiser-repl--this-buffer-repl))) + (equal cb geiser-repl--repl)) (geiser-repl--get-repl geiser-impl--implementation))))))) (defun geiser-repl--sentinel (proc event) @@ -460,12 +460,11 @@ module command as a string") "Documentation for module at point" :enable (symbol-at-point)) -- ("Kill Scheme interpreter" "\C-c\C-q" comint-kill-subjob - :enable (geiser-repl--this-buffer-repl)) - ("Restart" "\C-c\C-z" switch-to-geiser - :enable (not (geiser-repl--this-buffer-repl))) + :enable (geiser-repl--live-p)) + ("Restart" "\C-c\C-z" switch-to-geiser :enable (not (geiser-repl--live-p))) ("Revive REPL" "\C-c\C-k" geiser-repl-nuke "Use this command if the REPL becomes irresponsive" - :enable (geiser-repl--this-buffer-repl)) + :enable (geiser-repl--live-p)) -- (custom "REPL options" geiser-repl)) |