summaryrefslogtreecommitdiff
path: root/elisp/geiser-repl.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2020-12-02 18:33:26 +0000
committerjao <jao@gnu.org>2020-12-02 18:33:26 +0000
commit5f0fa551c65ecd0a1f096b59a1430b413e9f7faa (patch)
tree5f4cf7e9916cdb68a48dfb3e212f9563b15939fe /elisp/geiser-repl.el
parent13f1fbbadf902052da26a1e35415b779a3c3835c (diff)
downloadgeiser-5f0fa551c65ecd0a1f096b59a1430b413e9f7faa.tar.gz
geiser-5f0fa551c65ecd0a1f096b59a1430b413e9f7faa.tar.bz2
Support buffer-local binary and arglist configuration
Diffstat (limited to 'elisp/geiser-repl.el')
-rw-r--r--elisp/geiser-repl.el24
1 files changed, 20 insertions, 4 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 3b044a9..a576beb 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -518,9 +518,13 @@ module command as a string")
(defun geiser-repl--start-repl (impl address)
(message "Starting Geiser REPL ...")
(when (not address) (geiser-repl--check-version impl))
- (let ((buffer (current-buffer)))
+ (let ((buffer (current-buffer))
+ (binary (geiser-repl--binary impl))
+ (arglist (geiser-repl--arglist impl)))
(geiser-repl--to-repl-buffer impl)
- (setq geiser-repl--last-scm-buffer buffer))
+ (setq geiser-repl--last-scm-buffer buffer
+ geiser-repl--binary binary
+ geiser-repl--arglist arglist))
(sit-for 0)
(goto-char (point-max))
(geiser-repl--autodoc-mode -1)
@@ -556,9 +560,9 @@ module command as a string")
(buff (current-buffer))
(args (cond ((consp address) (list address))
((stringp address) '(()))
- (t `(,(geiser-repl--binary impl)
+ (t `(,(geiser-repl--get-binary impl)
nil
- ,@(geiser-repl--arglist impl))))))
+ ,@(geiser-repl--get-arglist impl))))))
(condition-case err
(if (and address (stringp address))
;; Connect over a Unix-domain socket.
@@ -940,6 +944,18 @@ over a Unix-domain socket."
(eq major-mode 'geiser-repl-mode))
(setq geiser-repl--last-scm-buffer buffer)))
+(make-variable-buffer-local
+ (defvar geiser-repl--binary nil))
+
+(make-variable-buffer-local
+ (defvar geiser-repl--arglist nil))
+
+(defun geiser-repl--get-binary (impl)
+ (or geiser-repl--binary (geiser-repl--binary impl)))
+
+(defun geiser-repl--get-arglist (impl)
+ (or geiser-repl--arglist (geiser-repl--arglist impl)))
+
(defun switch-to-geiser (&optional ask impl buffer)
"Switch to running Geiser REPL.