@@ -1443,21 +1443,54 @@ server buffer, in which case a new session for that server is created."
1443
1443
(plist-put :session-name ses-name)
1444
1444
(plist-put :repl-type 'cljs )))))
1445
1445
1446
- (defvar-local cider-connect-default-params nil
1447
- " Default plist of params to pass to `cider-connect' .
1448
- Recognized keys are :host, :port and :project-dir." )
1446
+ (defcustom cider-connect-default-params nil
1447
+ " Default plist of params for connecting to an external nREPL server.
1448
+ Recognized keys are :host, :port and :project-dir.
1449
+
1450
+ These are used as arguments to the commands `cider-connect-clj' ,
1451
+ `cider-connect-cljs' and `cider-connect-clj&cljs' , in order to bypass
1452
+ the corresponding user prompts.
1453
+
1454
+ This defcustom is intended for use with .dir-locals.el on a per-project basis.
1455
+ See `cider-connect-default-cljs-params' in order to specify a separate set of params
1456
+ for cljs REPL connections.
1457
+
1458
+ Note: it is recommended to set the variable `cider-default-cljs-repl'
1459
+ instead of specifying the :cljs-repl-type key."
1460
+ :type '(plist :key-type
1461
+ (choice (const :host )
1462
+ (const :port )
1463
+ (const :project-dir )))
1464
+ :group 'cider )
1465
+
1466
+ (defcustom cider-connect-default-cljs-params nil
1467
+ " Default plist of params for connecting to a ClojureScript REPL.
1468
+ Recognized keys are :host, :port and :project-dir.
1469
+
1470
+ If non-nil, overrides `cider-connect-default-params' for the commands
1471
+ `cider-connect-cljs' and (the latter half of) `cider-connect-clj&cljs' .
1472
+
1473
+ Note: it is recommended to set the variable `cider-default-cljs-repl'
1474
+ instead of specifying the :cljs-repl-type key."
1475
+ :type '(plist :key-type
1476
+ (choice (const :host )
1477
+ (const :port )
1478
+ (const :project-dir )))
1479
+ :group 'cider )
1449
1480
1450
1481
;;;### autoload
1451
1482
(defun cider-connect-clj (&optional params )
1452
1483
" Initialize a Clojure connection to an nREPL server.
1453
1484
PARAMS is a plist optionally containing :host, :port and :project-dir.
1454
1485
If nil, use the default parameters in `cider-connect-default-params' .
1455
- When called interactively with a prefix argument, prompt for all the
1456
- parameters."
1486
+
1487
+ With the prefix argument, prompt for all the parameters regardless of
1488
+ their supplied or default values."
1457
1489
(interactive " P" )
1458
1490
(cider-nrepl-connect
1459
- ; ; Make sure to copy the list, as the following steps will mutate it
1460
- (thread-first (or params (copy-sequence cider-connect-default-params))
1491
+ (thread-first (or params cider-connect-default-params)
1492
+ (copy-sequence ) ; ; Note: the following steps mutate the list
1493
+ (map-delete :cljs-repl-type )
1461
1494
(cider--update-project-dir)
1462
1495
(cider--update-host-port)
1463
1496
(cider--check-existing-session)
@@ -1470,12 +1503,17 @@ parameters."
1470
1503
" Initialize a ClojureScript connection to an nREPL server.
1471
1504
PARAMS is a plist optionally containing :host, :port, :project-dir and
1472
1505
:cljs-repl-type (e.g. 'shadow, 'node, 'figwheel, etc).
1506
+ If nil, use the default parameters in `cider-connect-default-params' or
1507
+ `cider-connect-default-cljs-params' .
1473
1508
1474
- On prefix, prompt for all the
1475
- parameters regardless of their supplied or default values."
1509
+ With the prefix argument , prompt for all the parameters regardless of
1510
+ their supplied or default values."
1476
1511
(interactive " P" )
1477
1512
(cider-nrepl-connect
1478
- (thread-first params
1513
+ (thread-first (or params
1514
+ cider-connect-default-cljs-params
1515
+ cider-connect-default-params)
1516
+ (copy-sequence )
1479
1517
(cider--update-project-dir)
1480
1518
(cider--update-host-port)
1481
1519
(cider--check-existing-session)
0 commit comments