summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-repl.el38
1 files changed, 30 insertions, 8 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 995bb3b..adc8872 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -327,10 +327,14 @@ module command as a string")
(defun geiser-repl--save-remote-data (address)
(setq geiser-repl--address address)
- (setq header-line-format (and address
- (format "Host: %s Port: %s"
- (geiser-repl--host)
- (geiser-repl--port)))))
+ (setq header-line-format
+ (cond ((consp address)
+ (format "Host: %s Port: %s"
+ (geiser-repl--host)
+ (geiser-repl--port)))
+ ((stringp address)
+ (format "Socket: %s" address))
+ (t nil))))
(defun geiser-repl--output-filter (txt)
(geiser-con--connection-update-debugging geiser-repl--connection txt)
@@ -384,10 +388,18 @@ module command as a string")
(setq comint-prompt-regexp prompt)
(let* ((name (geiser-repl--repl-name impl))
(buff (current-buffer))
- (args (if address (list address)
- `(,(geiser-repl--binary impl)
- nil
- ,@(geiser-repl--arglist impl)))))
+ (args (cond ((consp address) (list address))
+ ((stringp address) '(()))
+ (t `(,(geiser-repl--binary impl)
+ nil
+ ,@(geiser-repl--arglist impl))))))
+ (when (and address (stringp address))
+ ;; Connect over a Unix-domain socket.
+ (make-network-process :name (buffer-name buff)
+ :buffer buff
+ :family 'local
+ :remote address))
+
(condition-case err
(apply 'make-comint-in-buffer `(,name ,buff ,@args))
(error (insert "Unable to start REPL:\n"
@@ -715,6 +727,16 @@ buffer."
(geiser-repl--read-address host port))
(geiser-repl--maybe-remember-scm-buffer buffer)))
+(defun geiser-connect-local (impl &optional socket)
+ "Start a new Geiser REPL connected to a remote Scheme process
+over a Unix-domain socket."
+ (interactive
+ (list (geiser-repl--get-impl "Connect to Scheme implementation: ")))
+ (let ((buffer (current-buffer)))
+ (geiser-repl--start-repl impl
+ (read-file-name "Socket file name: "))
+ (geiser-repl--maybe-remember-scm-buffer buffer)))
+
(make-variable-buffer-local
(defvar geiser-repl--last-scm-buffer nil))