summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-08 05:43:58 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-08 05:43:58 +0100
commit92066980e04a39a65cca1966b56b11ed78362744 (patch)
tree52f643a13866fc4084b24a9cb5ed62a5ccc4933f /elisp
parent6c59e10f0e0bba91f08fbd7b5972940aae9b0cc6 (diff)
downloadgeiser-92066980e04a39a65cca1966b56b11ed78362744.tar.gz
geiser-92066980e04a39a65cca1966b56b11ed78362744.tar.bz2
Let geiser-connect take optional host and port args
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-repl.el19
1 files changed, 11 insertions, 8 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index b50f1d1..a05346c 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -206,11 +206,13 @@ module command as a string")
(defsubst geiser-repl--port () (cdr geiser-repl--address))
(defsubst geiser-repl--remote-p () geiser-repl--address)
-(defun geiser-repl--get-address ()
+(defun geiser-repl--get-address (&optional host port)
(let ((defhost (or (geiser-repl--host) geiser-repl-default-host))
(defport (or (geiser-repl--port) geiser-repl-default-port)))
- (cons (read-string (format "Host (default %s): " defhost) nil nil defhost)
- (read-number "Port: " defport))))
+ (cons (or host
+ (read-string (format "Host (default %s): " defhost)
+ nil nil defhost))
+ (or port (read-number "Port: " defport)))))
(defun geiser-repl--save-remote-data (remote address)
(setq geiser-repl--address (and remote address))
@@ -219,10 +221,10 @@ module command as a string")
(geiser-repl--host)
(geiser-repl--port)))))
-(defun geiser-repl--start-repl (impl &optional remote)
+(defun geiser-repl--start-repl (impl &optional remote host port)
(message "Starting Geiser REPL for %s ..." impl)
(geiser-repl--to-repl-buffer impl)
- (let ((program (if remote (geiser-repl--get-address)
+ (let ((program (if remote (geiser-repl--get-address host port)
(geiser-repl--binary impl)))
(args (geiser-repl--arglist impl))
(prompt-rx (geiser-repl--prompt-regexp impl))
@@ -289,7 +291,7 @@ module command as a string")
"Start Geiser for scheme implementation: "))))
(geiser-repl--start-repl impl))
-(defun geiser-connect (impl)
+(defun geiser-connect (impl &optional host port)
"Start a new Geiser REPL connected to a remote Scheme process."
(interactive
(list (or (geiser-repl--only-impl-p)
@@ -297,7 +299,7 @@ module command as a string")
geiser-impl--implementation)
(geiser-repl--read-impl
"Scheme implementation: "))))
- (geiser-repl--start-repl impl t))
+ (geiser-repl--start-repl impl t host port))
(make-variable-buffer-local
(defvar geiser-repl--last-scm-buffer nil))
@@ -343,7 +345,8 @@ If no REPL is running, execute `run-geiser' to start a fresh one."
"Switch to running Geiser REPL and try to enter a given module."
(interactive)
(let* ((module (or module
- (geiser-completion--read-module "Switch to module: ")))
+ (geiser-completion--read-module
+ "Switch to module (default top-level): ")))
(cmd (and module
(geiser-repl--enter-cmd geiser-impl--implementation
module))))