@@ -1344,11 +1344,10 @@ been determined."
1344
1344
" Fill-in the passed in PARAMS plist needed to start an nREPL server.
1345
1345
Updates :project-dir and :jack-in-cmd.
1346
1346
Also checks whether a matching session already exists."
1347
- (thread-first
1348
- params
1349
- (cider--update-project-dir)
1350
- (cider--check-existing-session)
1351
- (cider--update-jack-in-cmd)))
1347
+ (thread-first params
1348
+ (cider--update-project-dir)
1349
+ (cider--check-existing-session)
1350
+ (cider--update-jack-in-cmd)))
1352
1351
1353
1352
;;;### autoload
1354
1353
(defun cider-jack-in-clj (params )
@@ -1387,11 +1386,10 @@ these parameters."
1387
1386
(cider-jack-in-nrepl-middlewares (append cider-jack-in-nrepl-middlewares cider-jack-in-cljs-nrepl-middlewares))
1388
1387
(orig-buffer (current-buffer )))
1389
1388
; ; cider--update-jack-in-cmd relies indirectly on the above dynamic vars
1390
- (let ((params (thread-first
1391
- params
1392
- (cider--update-project-dir)
1393
- (cider--check-existing-session)
1394
- (cider--update-jack-in-cmd))))
1389
+ (let ((params (thread-first params
1390
+ (cider--update-project-dir)
1391
+ (cider--check-existing-session)
1392
+ (cider--update-jack-in-cmd))))
1395
1393
(nrepl-start-server-process
1396
1394
(plist-get params :project-dir )
1397
1395
(plist-get params :jack-in-cmd )
@@ -1417,14 +1415,13 @@ only when the ClojureScript dependencies are met."
1417
1415
(cider-jack-in-nrepl-middlewares (append cider-jack-in-nrepl-middlewares cider-jack-in-cljs-nrepl-middlewares))
1418
1416
(orig-buffer (current-buffer )))
1419
1417
; ; cider--update-jack-in-cmd relies indirectly on the above dynamic vars
1420
- (let ((params (thread-first
1421
- params
1422
- (cider--update-project-dir)
1423
- (cider--check-existing-session)
1424
- (cider--update-jack-in-cmd)
1425
- (cider--update-cljs-type)
1426
- ; ; already asked, don't ask on sibling connect
1427
- (plist-put :do-prompt nil ))))
1418
+ (let ((params (thread-first params
1419
+ (cider--update-project-dir)
1420
+ (cider--check-existing-session)
1421
+ (cider--update-jack-in-cmd)
1422
+ (cider--update-cljs-type)
1423
+ ; ; already asked, don't ask on sibling connect
1424
+ (plist-put :do-prompt nil ))))
1428
1425
(nrepl-start-server-process
1429
1426
(plist-get params :project-dir )
1430
1427
(plist-get params :jack-in-cmd )
@@ -1449,13 +1446,12 @@ server is created."
1449
1446
(other-params (cider--gather-connect-params nil other-repl))
1450
1447
(ses-name (unless (nrepl-server-p other-repl)
1451
1448
(sesman-session-name-for-object 'CIDER other-repl))))
1452
- (thread-first
1453
- params
1454
- (cider--update-do-prompt)
1455
- (append other-params)
1456
- (plist-put :repl-init-function nil )
1457
- (plist-put :repl-type 'clj )
1458
- (plist-put :session-name ses-name)))))
1449
+ (thread-first params
1450
+ (cider--update-do-prompt)
1451
+ (append other-params)
1452
+ (plist-put :repl-init-function nil )
1453
+ (plist-put :repl-type 'clj )
1454
+ (plist-put :session-name ses-name)))))
1459
1455
1460
1456
;;;### autoload
1461
1457
(defun cider-connect-sibling-cljs (params &optional other-repl )
@@ -1474,14 +1470,13 @@ server buffer, in which case a new session for that server is created."
1474
1470
(ses-name (unless (nrepl-server-p other-repl)
1475
1471
(sesman-session-name-for-object 'CIDER other-repl))))
1476
1472
(cider-nrepl-connect
1477
- (thread-first
1478
- params
1479
- (cider--update-do-prompt)
1480
- (append other-params)
1481
- (cider--update-cljs-type)
1482
- (cider--update-cljs-init-function)
1483
- (plist-put :session-name ses-name)
1484
- (plist-put :repl-type 'cljs )))))
1473
+ (thread-first params
1474
+ (cider--update-do-prompt)
1475
+ (append other-params)
1476
+ (cider--update-cljs-type)
1477
+ (cider--update-cljs-init-function)
1478
+ (plist-put :session-name ses-name)
1479
+ (plist-put :repl-type 'cljs )))))
1485
1480
1486
1481
;;;### autoload
1487
1482
(defun cider-connect-clj (&optional params )
@@ -1490,14 +1485,13 @@ PARAMS is a plist optionally containing :host, :port and :project-dir. On
1490
1485
prefix argument, prompt for all the parameters."
1491
1486
(interactive " P" )
1492
1487
(cider-nrepl-connect
1493
- (thread-first
1494
- params
1495
- (cider--update-project-dir)
1496
- (cider--update-host-port)
1497
- (cider--check-existing-session)
1498
- (plist-put :repl-init-function nil )
1499
- (plist-put :session-name nil )
1500
- (plist-put :repl-type 'clj ))))
1488
+ (thread-first params
1489
+ (cider--update-project-dir)
1490
+ (cider--update-host-port)
1491
+ (cider--check-existing-session)
1492
+ (plist-put :repl-init-function nil )
1493
+ (plist-put :session-name nil )
1494
+ (plist-put :repl-type 'clj ))))
1501
1495
1502
1496
;;;### autoload
1503
1497
(defun cider-connect-cljs (&optional params )
@@ -1509,15 +1503,14 @@ On prefix, prompt for all the
1509
1503
parameters regardless of their supplied or default values."
1510
1504
(interactive " P" )
1511
1505
(cider-nrepl-connect
1512
- (thread-first
1513
- params
1514
- (cider--update-project-dir)
1515
- (cider--update-host-port)
1516
- (cider--check-existing-session)
1517
- (cider--update-cljs-type)
1518
- (cider--update-cljs-init-function)
1519
- (plist-put :session-name nil )
1520
- (plist-put :repl-type 'cljs ))))
1506
+ (thread-first params
1507
+ (cider--update-project-dir)
1508
+ (cider--update-host-port)
1509
+ (cider--check-existing-session)
1510
+ (cider--update-cljs-type)
1511
+ (cider--update-cljs-init-function)
1512
+ (plist-put :session-name nil )
1513
+ (plist-put :repl-type 'cljs ))))
1521
1514
1522
1515
;;;### autoload
1523
1516
(defun cider-connect-clj&cljs (params &optional soft-cljs-start )
@@ -1526,16 +1519,14 @@ PARAMS is a plist optionally containing :host, :port, :project-dir and
1526
1519
:cljs-repl-type (e.g. 'shadow, 'node, 'figwheel, etc). When SOFT-CLJS-START is
1527
1520
non-nil, don't start if ClojureScript requirements are not met."
1528
1521
(interactive " P" )
1529
- (let* ((params (thread-first
1530
- params
1531
- (cider--update-project-dir)
1532
- (cider--update-host-port)
1533
- (cider--check-existing-session)
1534
- (cider--update-cljs-type)))
1535
- (clj-params (thread-first
1536
- params
1537
- copy-sequence
1538
- (map-delete :cljs-repl-type )))
1522
+ (let* ((params (thread-first params
1523
+ (cider--update-project-dir)
1524
+ (cider--update-host-port)
1525
+ (cider--check-existing-session)
1526
+ (cider--update-cljs-type)))
1527
+ (clj-params (thread-first params
1528
+ copy-sequence
1529
+ (map-delete :cljs-repl-type )))
1539
1530
(clj-repl (cider-connect-clj clj-params)))
1540
1531
(when (if soft-cljs-start
1541
1532
(cider--check-cljs (plist-get params :cljs-repl-type ) 'no-error )
@@ -1605,10 +1596,9 @@ Params is a plist with the following keys (non-exhaustive)
1605
1596
(setq-local buffer-file-name nil ))
1606
1597
(let ((default-directory proj-dir))
1607
1598
(hack-dir-local-variables-non-file-buffer )
1608
- (thread-first
1609
- params
1610
- (plist-put :project-dir proj-dir)
1611
- (plist-put :--context-buffer (current-buffer )))))))))
1599
+ (thread-first params
1600
+ (plist-put :project-dir proj-dir)
1601
+ (plist-put :--context-buffer (current-buffer )))))))))
1612
1602
1613
1603
(defun cider--update-cljs-type (params )
1614
1604
" Update :cljs-repl-type in PARAMS."
@@ -1704,10 +1694,9 @@ PARAMS is a plist with the following keys (non-exhaustive list)
1704
1694
(cider-select-endpoint)))))
1705
1695
(if (equal " local-unix-domain-socket" (car endpoint))
1706
1696
(plist-put params :socket-file (cdr endpoint))
1707
- (thread-first
1708
- params
1709
- (plist-put :host (car endpoint))
1710
- (plist-put :port (cdr endpoint)))))))
1697
+ (thread-first params
1698
+ (plist-put :host (car endpoint))
1699
+ (plist-put :port (cdr endpoint)))))))
1711
1700
1712
1701
(defun cider--update-cljs-init-function (params )
1713
1702
" Update repl type and any init PARAMS for cljs connections.
@@ -1728,21 +1717,20 @@ over to cljs.
1728
1717
(if (null repl-init-form)
1729
1718
(plist-put params :cider-repl-cljs-upgrade-pending nil )
1730
1719
1731
- (thread-first
1732
- params
1733
- (plist-put :cider-repl-cljs-upgrade-pending t )
1734
- (plist-put :repl-init-function
1735
- (lambda ()
1736
- (cider--check-cljs cljs-type)
1737
- (cider-nrepl-send-request
1738
- (list " op" " eval"
1739
- " ns" (cider-current-ns)
1740
- " code" repl-init-form)
1741
- (cider-repl-handler (current-buffer )))
1742
- (when (and (buffer-live-p nrepl-server-buffer)
1743
- cider-offer-to-open-cljs-app-in-browser)
1744
- (cider--offer-to-open-app-in-browser nrepl-server-buffer))))
1745
- (plist-put :repl-init-form repl-init-form))))))
1720
+ (thread-first params
1721
+ (plist-put :cider-repl-cljs-upgrade-pending t )
1722
+ (plist-put :repl-init-function
1723
+ (lambda ()
1724
+ (cider--check-cljs cljs-type)
1725
+ (cider-nrepl-send-request
1726
+ (list " op" " eval"
1727
+ " ns" (cider-current-ns)
1728
+ " code" repl-init-form)
1729
+ (cider-repl-handler (current-buffer )))
1730
+ (when (and (buffer-live-p nrepl-server-buffer)
1731
+ cider-offer-to-open-cljs-app-in-browser)
1732
+ (cider--offer-to-open-app-in-browser nrepl-server-buffer))))
1733
+ (plist-put :repl-init-form repl-init-form))))))
1746
1734
1747
1735
(defun cider--check-existing-session (params )
1748
1736
" Ask for confirmation if a session with similar PARAMS already exists.
0 commit comments