summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cider.el2
-rw-r--r--nrepl-client.el4
2 files changed, 5 insertions, 1 deletions
diff --git a/cider.el b/cider.el
index f26f6b3a..78e752e7 100644
--- a/cider.el
+++ b/cider.el
@@ -94,7 +94,7 @@ start the server."
;;;###autoload
(defun cider (host port)
"Connect to an nREPL server identified by HOST and PORT."
- (interactive (list (read-string "Host: " nrepl-host nil nrepl-host)
+ (interactive (list (read-string "Host: " (nrepl-current-host) nil (nrepl-current-host))
(string-to-number (let ((port (nrepl-default-port)))
(read-string "Port: " port nil port)))))
(setq cider-current-clojure-buffer (current-buffer))
diff --git a/nrepl-client.el b/nrepl-client.el
index 27e4d93a..a3a89a5f 100644
--- a/nrepl-client.el
+++ b/nrepl-client.el
@@ -419,6 +419,10 @@ This is bound for the duration of the handling of that message")
"A list of connections.")
+(defun nrepl-current-host ()
+ (if (and (stringp buffer-file-name)
+ (file-remote-p buffer-file-name))
+ tramp-current-host nrepl-host))
(defun nrepl-make-connection-buffer ()
"Create an nREPL connection buffer."