@@ -161,11 +161,11 @@ precedence over other connections associated with the same project.
161
161
162
162
If ALL-CONNECTIONS is non-nil, the return value is a list and all matching
163
163
connections are returned, instead of just the most recent."
164
- (when-let ((project-directory (or project-directory
164
+ (when-let* ((project-directory (or project-directory
165
165
(clojure-project-dir (cider-current-dir))))
166
166
(fn (if all-connections #'seq-filter #'seq-find )))
167
167
(or (funcall fn (lambda (conn )
168
- (when-let ((conn-proj-dir (with-current-buffer conn
168
+ (when-let* ((conn-proj-dir (with-current-buffer conn
169
169
nrepl-project-dir)))
170
170
(equal (file-truename project-directory)
171
171
(file-truename conn-proj-dir))))
@@ -306,7 +306,7 @@ at all."
306
306
" Return the first connection of another type than CONNECTION.
307
307
Only return connections in the same project or nil.
308
308
CONNECTION defaults to `cider-current-connection' ."
309
- (when-let ((connection (or connection (cider-current-connection)))
309
+ (when-let* ((connection (or connection (cider-current-connection)))
310
310
(connection-type (cider--connection-type connection)))
311
311
(cider-current-connection (pcase connection-type
312
312
(`" clj" " cljs" )
@@ -319,7 +319,7 @@ CONNECTION defaults to `cider-current-connection'."
319
319
DO NOT USE THIS FUNCTION.
320
320
It was written only to be used in `cider-map-connections' , as a workaround
321
321
to a still-undetermined bug in the state-stracker backend."
322
- (when-let ((project-connections (cider-find-connection-buffer-for-project-directory
322
+ (when-let* ((project-connections (cider-find-connection-buffer-for-project-directory
323
323
nil :all-connections ))
324
324
(cljs-conn
325
325
; ; So we have multiple connections. Look for the connection type we
@@ -389,7 +389,7 @@ connection but can be invoked from any buffer (like `cider-refresh')."
389
389
((err " needs a ClojureScript REPL" )))))))
390
390
(funcall function curr)
391
391
(when (eq which :both )
392
- (when-let ((other-connection (cider-other-connection curr)))
392
+ (when-let* ((other-connection (cider-other-connection curr)))
393
393
(funcall function other-connection))))))
394
394
395
395
@@ -419,7 +419,7 @@ connection but can be invoked from any buffer (like `cider-refresh')."
419
419
(defun cider-connection-browser ()
420
420
" Open a browser buffer for nREPL connections."
421
421
(interactive )
422
- (if-let ((buffer (get-buffer cider--connection-browser-buffer-name)))
422
+ (if-let* ((buffer (get-buffer cider--connection-browser-buffer-name)))
423
423
(progn
424
424
(cider--connections-refresh-buffer buffer)
425
425
(unless (get-buffer-window buffer)
@@ -430,7 +430,7 @@ connection but can be invoked from any buffer (like `cider-refresh')."
430
430
" Refresh the connections buffer, if the buffer exists.
431
431
The connections buffer is determined by
432
432
`cider--connection-browser-buffer-name' "
433
- (when-let ((buffer (get-buffer cider--connection-browser-buffer-name)))
433
+ (when-let* ((buffer (get-buffer cider--connection-browser-buffer-name)))
434
434
(cider--connections-refresh-buffer buffer)))
435
435
436
436
(add-hook 'nrepl-disconnected-hook #'cider--connections-refresh )
@@ -622,7 +622,7 @@ REPL's ns, otherwise fall back to \"user\".
622
622
When NO-DEFAULT is non-nil, it will return nil instead of \" user\" ."
623
623
(or cider-buffer-ns
624
624
(clojure-find-ns)
625
- (when-let ((repl-buf (cider-current-connection)))
625
+ (when-let* ((repl-buf (cider-current-connection)))
626
626
(buffer-local-value 'cider-buffer-ns repl-buf))
627
627
(if no-default nil " user" )))
628
628
@@ -835,15 +835,15 @@ unless ALL is truthy."
835
835
" Find the definition of VAR, optionally at a specific LINE.
836
836
837
837
Display the results in a different window."
838
- (if-let ((info (cider-var-info var)))
838
+ (if-let* ((info (cider-var-info var)))
839
839
(progn
840
840
(if line (setq info (nrepl-dict-put info " line" line)))
841
841
(cider--jump-to-loc-from-info info t ))
842
842
(user-error " Symbol `%s' not resolved" var)))
843
843
844
844
(defun cider--find-var (var &optional line )
845
845
" Find the definition of VAR, optionally at a specific LINE."
846
- (if-let ((info (cider-var-info var)))
846
+ (if-let* ((info (cider-var-info var)))
847
847
(progn
848
848
(if line (setq info (nrepl-dict-put info " line" line)))
849
849
(cider--jump-to-loc-from-info info))
@@ -931,11 +931,11 @@ Optional arguments include SEARCH-NS, DOCS-P, PRIVATES-P, CASE-SENSITIVE-P."
931
931
(defun cider-sync-request:complete (str context )
932
932
" Return a list of completions for STR using nREPL's \" complete\" op.
933
933
CONTEXT represents a completion context for compliment."
934
- (when-let ((dict (thread-first `(" op" " complete"
935
- " ns" ,(cider-current-ns)
936
- " symbol" , str
937
- " context" , context )
938
- (cider-nrepl-send-sync-request nil 'abort-on-input ))))
934
+ (when-let* ((dict (thread-first `(" op" " complete"
935
+ " ns" ,(cider-current-ns)
936
+ " symbol" , str
937
+ " context" , context )
938
+ (cider-nrepl-send-sync-request nil 'abort-on-input ))))
939
939
(nrepl-dict-get dict " completions" )))
940
940
941
941
(defun cider-sync-request:complete-flush-caches ()
@@ -958,22 +958,22 @@ CONTEXT represents a completion context for compliment."
958
958
959
959
(defun cider-sync-request:eldoc (symbol &optional class member )
960
960
" Send \" eldoc\" op with parameters SYMBOL or CLASS and MEMBER."
961
- (when-let ((eldoc (thread-first `(" op" " eldoc"
962
- " ns" ,(cider-current-ns)
963
- ,@(when symbol `(" symbol" , symbol ))
964
- ,@(when class `(" class" , class ))
965
- ,@(when member `(" member" , member )))
966
- (cider-nrepl-send-sync-request nil 'abort-on-input ))))
961
+ (when-let* ((eldoc (thread-first `(" op" " eldoc"
962
+ " ns" ,(cider-current-ns)
963
+ ,@(when symbol `(" symbol" , symbol ))
964
+ ,@(when class `(" class" , class ))
965
+ ,@(when member `(" member" , member )))
966
+ (cider-nrepl-send-sync-request nil 'abort-on-input ))))
967
967
(if (member " no-eldoc" (nrepl-dict-get eldoc " status" ))
968
968
nil
969
969
eldoc)))
970
970
971
971
(defun cider-sync-request:eldoc-datomic-query (symbol )
972
972
" Send \" eldoc-datomic-query\" op with parameter SYMBOL."
973
- (when-let ((eldoc (thread-first `(" op" " eldoc-datomic-query"
974
- " ns" ,(cider-current-ns)
975
- ,@(when symbol `(" symbol" , symbol )))
976
- (cider-nrepl-send-sync-request nil 'abort-on-input ))))
973
+ (when-let* ((eldoc (thread-first `(" op" " eldoc-datomic-query"
974
+ " ns" ,(cider-current-ns)
975
+ ,@(when symbol `(" symbol" , symbol )))
976
+ (cider-nrepl-send-sync-request nil 'abort-on-input ))))
977
977
(if (member " no-eldoc" (nrepl-dict-get eldoc " status" ))
978
978
nil
979
979
eldoc)))
0 commit comments