@@ -1500,21 +1500,54 @@ server buffer, in which case a new session for that server is created."
1500
1500
(plist-put :session-name ses-name)
1501
1501
(plist-put :repl-type 'cljs )))))
1502
1502
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." )
1503
+ (defcustom cider-connect-default-params nil
1504
+ " Default plist of params for connecting to an external nREPL server.
1505
+ Recognized keys are :host, :port and :project-dir.
1506
+
1507
+ These are used as arguments to the commands `cider-connect-clj' ,
1508
+ `cider-connect-cljs' and `cider-connect-clj&cljs' , in order to bypass
1509
+ the corresponding user prompts.
1510
+
1511
+ This defcustom is intended for use with .dir-locals.el on a per-project basis.
1512
+ See `cider-connect-default-cljs-params' in order to specify a separate set of params
1513
+ for cljs REPL connections.
1514
+
1515
+ Note: it is recommended to set the variable `cider-default-cljs-repl'
1516
+ instead of specifying the :cljs-repl-type key."
1517
+ :type '(plist :key-type
1518
+ (choice (const :host )
1519
+ (const :port )
1520
+ (const :project-dir )))
1521
+ :group 'cider )
1522
+
1523
+ (defcustom cider-connect-default-cljs-params nil
1524
+ " Default plist of params for connecting to a ClojureScript REPL.
1525
+ Recognized keys are :host, :port and :project-dir.
1526
+
1527
+ If non-nil, overrides `cider-connect-default-params' for the commands
1528
+ `cider-connect-cljs' and (the latter half of) `cider-connect-clj&cljs' .
1529
+
1530
+ Note: it is recommended to set the variable `cider-default-cljs-repl'
1531
+ instead of specifying the :cljs-repl-type key."
1532
+ :type '(plist :key-type
1533
+ (choice (const :host )
1534
+ (const :port )
1535
+ (const :project-dir )))
1536
+ :group 'cider )
1506
1537
1507
1538
;;;### autoload
1508
1539
(defun cider-connect-clj (&optional params )
1509
1540
" Initialize a Clojure connection to an nREPL server.
1510
1541
PARAMS is a plist optionally containing :host, :port and :project-dir.
1511
1542
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."
1543
+
1544
+ With the prefix argument, prompt for all the parameters regardless of
1545
+ their supplied or default values."
1514
1546
(interactive " P" )
1515
1547
(cider-nrepl-connect
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))
1548
+ (thread-first (or params cider-connect-default-params)
1549
+ (copy-sequence ) ; ; Note: the following steps mutate the list
1550
+ (map-delete :cljs-repl-type )
1518
1551
(cider--update-project-dir)
1519
1552
(cider--update-host-port)
1520
1553
(cider--check-existing-session)
@@ -1527,12 +1560,17 @@ parameters."
1527
1560
" Initialize a ClojureScript connection to an nREPL server.
1528
1561
PARAMS is a plist optionally containing :host, :port, :project-dir and
1529
1562
:cljs-repl-type (e.g. 'shadow, 'node, 'figwheel, etc).
1563
+ If nil, use the default parameters in `cider-connect-default-params' or
1564
+ `cider-connect-default-cljs-params' .
1530
1565
1531
- On prefix, prompt for all the
1532
- parameters regardless of their supplied or default values."
1566
+ With the prefix argument , prompt for all the parameters regardless of
1567
+ their supplied or default values."
1533
1568
(interactive " P" )
1534
1569
(cider-nrepl-connect
1535
- (thread-first params
1570
+ (thread-first (or params
1571
+ cider-connect-default-cljs-params
1572
+ cider-connect-default-params)
1573
+ (copy-sequence )
1536
1574
(cider--update-project-dir)
1537
1575
(cider--update-host-port)
1538
1576
(cider--check-existing-session)
0 commit comments