summaryrefslogtreecommitdiff
path: root/elisp
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
commit7626c49bde93463e2a509ac31f8dbc8feed3d973 (patch)
tree5714bf845956e0089ab81b8b67ee7cab4c2b5720 /elisp
parentc425acc5528bd24ca90fa7b5b3c3edba12b8f4fb (diff)
downloadgeiser-guile-7626c49bde93463e2a509ac31f8dbc8feed3d973.tar.gz
geiser-guile-7626c49bde93463e2a509ac31f8dbc8feed3d973.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')
-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)))