Skip to content

Commit f56f1f7

Browse files
committed
feat: specify default connection params
1 parent 176a8e7 commit f56f1f7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Diff for: cider.el

+10-3
Original file line numberDiff line numberDiff line change
@@ -1500,14 +1500,21 @@ server buffer, in which case a new session for that server is created."
15001500
(plist-put :session-name ses-name)
15011501
(plist-put :repl-type 'cljs)))))
15021502

1503+
(defvar-local cider-connect-default-params nil
1504+
"Default plist of params to pass to `cider-connect'.
1505+
Recognized keys are :host, :port and :project-dir.")
1506+
15031507
;;;###autoload
15041508
(defun cider-connect-clj (&optional params)
15051509
"Initialize a Clojure connection to an nREPL server.
1506-
PARAMS is a plist optionally containing :host, :port and :project-dir. On
1507-
prefix argument, prompt for all the parameters."
1510+
PARAMS is a plist optionally containing :host, :port and :project-dir.
1511+
If nil, use the default parameters in `cider-connect-default-params'.
1512+
When called interactively with a prefix argument, prompt for all the
1513+
parameters."
15081514
(interactive "P")
15091515
(cider-nrepl-connect
1510-
(thread-first params
1516+
;; Make sure to copy the list, as the following steps will mutate it
1517+
(thread-first (or params (copy-sequence cider-connect-default-params))
15111518
(cider--update-project-dir)
15121519
(cider--update-host-port)
15131520
(cider--check-existing-session)

0 commit comments

Comments
 (0)