summaryrefslogtreecommitdiff
path: root/elisp/geiser-repl.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2016-04-07 16:25:43 +0300
committerAlex Kost <alezost@gmail.com>2016-04-07 16:25:43 +0300
commitd12d33ae340198db6ea68a3ca60b4133e7e8d161 (patch)
tree4413119b7501721ff3518e7bb2f649c26b08ebe1 /elisp/geiser-repl.el
parent8067a4ed730195664f3f63b6ee35cb9c2647608b (diff)
downloadgeiser-d12d33ae340198db6ea68a3ca60b4133e7e8d161.tar.gz
geiser-d12d33ae340198db6ea68a3ca60b4133e7e8d161.tar.bz2
Fix REPL reconnecting
This fixes 2 issues: 1. Reconnecting to a remote process prompts for host/port, although it is not needed. 2. 'geiser-connect' should be used only if 'geiser-repl--address' is a host/port pair. When it is a socket file name, 'geiser-connect-local' should be used.
Diffstat (limited to 'elisp/geiser-repl.el')
-rw-r--r--elisp/geiser-repl.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 88e1ce3..46d240c 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -320,7 +320,13 @@ module command as a string")
(make-variable-buffer-local
(defvar geiser-repl--connection nil))
-(defun geiser-repl--remote-p () geiser-repl--address)
+(defun geiser-repl--local-p ()
+ "Return non-nil, if current REPL is local (connected to socket)."
+ (stringp geiser-repl--address))
+
+(defun geiser-repl--remote-p ()
+ "Return non-nil, if current REPL is remote (connected to host:port)."
+ (consp geiser-repl--address))
(defsubst geiser-repl--host () (car geiser-repl--address))
(defsubst geiser-repl--port () (cdr geiser-repl--address))
@@ -801,7 +807,10 @@ If no REPL is running, execute `run-geiser' to start a fresh one."
(when (buffer-live-p geiser-repl--last-scm-buffer)
(geiser-repl--switch-to-buffer geiser-repl--last-scm-buffer)))
(repl (geiser-repl--switch-to-buffer repl))
- ((geiser-repl--remote-p) (geiser-connect impl))
+ ((geiser-repl--remote-p)
+ (geiser-connect impl (geiser-repl--host) (geiser-repl--port)))
+ ((geiser-repl--local-p)
+ (geiser-connect-local impl geiser-repl--address))
(impl (run-geiser impl))
(t (call-interactively 'run-geiser)))
(geiser-repl--maybe-remember-scm-buffer buffer)))