 (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))

                                        (geiser-repl--host)
                                        (geiser-repl--port)))))

(defun geiser-repl--start-repl (impl &optional remote)
  (message "Starting Geiser REPL for %s ..." impl)
  (geiser-repl--to-repl-buffer impl)
  (let ((program (if remote (geiser-repl--get-address)
                   (geiser-repl--binary impl)))
        (args (geiser-repl--arglist impl))
        (prompt-rx (geiser-repl--prompt-regexp impl))

  "Switch to running Geiser REPL and try to enter a given module."
  (interactive)
  (let* ((module (or module
                     (geiser-completion--read-module
                      "Switch to module (default top-level): ")))
         (cmd (and module
                   (geiser-repl--enter-cmd geiser-impl--implementation
                                           module))))
