Skip to content

Commit

Permalink
feat: specify default connection params
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhan0 committed Jun 25, 2023
1 parent 1367b25 commit 5036392
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cider.el
Original file line number Diff line number Diff line change
Expand Up @@ -1390,15 +1390,22 @@ server buffer, in which case a new session for that server is created."
(plist-put :session-name ses-name)
(plist-put :repl-type 'cljs)))))

(defvar-local cider-connect-default-params nil
"Default plist of params to pass to `cider-connect'.
Recognized keys are :host, :port and :project-dir.")

;;;###autoload
(defun cider-connect-clj (&optional params)
"Initialize a Clojure connection to an nREPL server.
PARAMS is a plist optionally containing :host, :port and :project-dir. On
prefix argument, prompt for all the parameters."
PARAMS is a plist optionally containing :host, :port and :project-dir.
If nil, use the default parameters in `cider-connect-default-params'.
When called interactively with a prefix argument, prompt for all the
parameters."
(interactive "P")
(cider-nrepl-connect
(thread-first
params
;; Make sure to copy the list, as the following steps will mutate it
(or params (copy-sequence cider-connect-default-params))
(cider--update-project-dir)
(cider--update-host-port)
(cider--check-existing-session)
Expand Down

0 comments on commit 5036392

Please sign in to comment.