summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cider-apropos.el14
-rw-r--r--cider-browse-spec.el6
-rw-r--r--cider-classpath.el2
-rw-r--r--cider-client.el50
-rw-r--r--cider-common.el14
-rw-r--r--cider-compat.el12
-rw-r--r--cider-debug.el22
-rw-r--r--cider-doc.el14
-rw-r--r--cider-eldoc.el36
-rw-r--r--cider-grimoire.el4
-rw-r--r--cider-inspector.el14
-rw-r--r--cider-interaction.el46
-rw-r--r--cider-macroexpansion.el2
-rw-r--r--cider-mode.el20
-rw-r--r--cider-overlays.el2
-rw-r--r--cider-repl-history.el2
-rw-r--r--cider-repl.el20
-rw-r--r--cider-resolve.el8
-rw-r--r--cider-stacktrace.el8
-rw-r--r--cider-test.el24
-rw-r--r--cider-util.el18
-rw-r--r--cider.el50
-rw-r--r--doc/indent_spec.md2
-rw-r--r--nrepl-client.el20
-rw-r--r--test/cider-tests--no-auto.el2
25 files changed, 206 insertions, 206 deletions
diff --git a/cider-apropos.el b/cider-apropos.el
index b9a6fd79..ee214622 100644
--- a/cider-apropos.el
+++ b/cider-apropos.el
@@ -144,9 +144,9 @@ optionally search doc strings (based on DOCS-P), include private vars
(y-or-n-p "Case-sensitive? ")))))
(cider-ensure-connected)
(cider-ensure-op-supported "apropos")
- (if-let ((summary (cider-apropos-summary
- query ns docs-p privates-p case-sensitive-p))
- (results (cider-sync-request:apropos query ns docs-p privates-p case-sensitive-p)))
+ (if-let* ((summary (cider-apropos-summary
+ query ns docs-p privates-p case-sensitive-p))
+ (results (cider-sync-request:apropos query ns docs-p privates-p case-sensitive-p)))
(cider-show-apropos summary results query docs-p)
(message "No apropos matches for %S" query)))
@@ -191,10 +191,10 @@ optionally search doc strings (based on DOCS-P), include private vars
(y-or-n-p "Case-sensitive? ")))))
(cider-ensure-connected)
(cider-ensure-op-supported "apropos")
- (if-let ((summary (cider-apropos-summary
- query ns docs-p privates-p case-sensitive-p))
- (results (mapcar (lambda (r) (nrepl-dict-get r "name"))
- (cider-sync-request:apropos query ns docs-p privates-p case-sensitive-p))))
+ (if-let* ((summary (cider-apropos-summary
+ query ns docs-p privates-p case-sensitive-p))
+ (results (mapcar (lambda (r) (nrepl-dict-get r "name"))
+ (cider-sync-request:apropos query ns docs-p privates-p case-sensitive-p))))
(cider-apropos-act-on-symbol (completing-read (concat summary ": ") results))
(message "No apropos matches for %S" query)))
diff --git a/cider-browse-spec.el b/cider-browse-spec.el
index 858fbf98..da4440b2 100644
--- a/cider-browse-spec.el
+++ b/cider-browse-spec.el
@@ -282,7 +282,7 @@ may also be a button, so this function can be used a the button's `action'
property."
(interactive)
(let ((pos (or pos (point))))
- (when-let ((spec (button-get pos 'spec-name)))
+ (when-let* ((spec (button-get pos 'spec-name)))
(cider-browse-spec--browse spec))))
;; Interactive Functions
@@ -292,8 +292,8 @@ property."
(interactive)
(cider-ensure-connected)
(cider-ensure-op-supported "spec-example")
- (if-let ((spec cider-browse-spec--current-spec))
- (if-let ((example (cider-sync-request:spec-example spec)))
+ (if-let* ((spec cider-browse-spec--current-spec))
+ (if-let* ((example (cider-sync-request:spec-example spec)))
(with-current-buffer (cider-popup-buffer cider-browse-spec-example-buffer t)
(cider-browse-spec-example-mode)
(setq-local cider-browse-spec--current-spec spec)
diff --git a/cider-classpath.el b/cider-classpath.el
index 831d6d59..5dbbf3b0 100644
--- a/cider-classpath.el
+++ b/cider-classpath.el
@@ -104,7 +104,7 @@
(interactive)
(cider-ensure-connected)
(cider-ensure-op-supported "classpath")
- (when-let ((entry (completing-read "Classpath entries: " (cider-sync-request:classpath))))
+ (when-let* ((entry (completing-read "Classpath entries: " (cider-sync-request:classpath))))
(find-file-other-window entry)))
(provide 'cider-classpath)
diff --git a/cider-client.el b/cider-client.el
index 0472913c..0b8dafe4 100644
--- a/cider-client.el
+++ b/cider-client.el
@@ -161,11 +161,11 @@ precedence over other connections associated with the same project.
If ALL-CONNECTIONS is non-nil, the return value is a list and all matching
connections are returned, instead of just the most recent."
- (when-let ((project-directory (or project-directory
+ (when-let* ((project-directory (or project-directory
(clojure-project-dir (cider-current-dir))))
(fn (if all-connections #'seq-filter #'seq-find)))
(or (funcall fn (lambda (conn)
- (when-let ((conn-proj-dir (with-current-buffer conn
+ (when-let* ((conn-proj-dir (with-current-buffer conn
nrepl-project-dir)))
(equal (file-truename project-directory)
(file-truename conn-proj-dir))))
@@ -304,7 +304,7 @@ at all."
"Return the first connection of another type than CONNECTION.
Only return connections in the same project or nil.
CONNECTION defaults to `cider-current-connection'."
- (when-let ((connection (or connection (cider-current-connection)))
+ (when-let* ((connection (or connection (cider-current-connection)))
(connection-type (cider--connection-type connection)))
(cider-current-connection (pcase connection-type
(`"clj" "cljs")
@@ -317,7 +317,7 @@ CONNECTION defaults to `cider-current-connection'."
DO NOT USE THIS FUNCTION.
It was written only to be used in `cider-map-connections', as a workaround
to a still-undetermined bug in the state-stracker backend."
- (when-let ((project-connections (cider-find-connection-buffer-for-project-directory
+ (when-let* ((project-connections (cider-find-connection-buffer-for-project-directory
nil :all-connections))
(cljs-conn
;; So we have multiple connections. Look for the connection type we
@@ -387,7 +387,7 @@ connection but can be invoked from any buffer (like `cider-refresh')."
((err "needs a ClojureScript REPL")))))))
(funcall function curr)
(when (eq which :both)
- (when-let ((other-connection (cider-other-connection curr)))
+ (when-let* ((other-connection (cider-other-connection curr)))
(funcall function other-connection))))))
@@ -417,7 +417,7 @@ connection but can be invoked from any buffer (like `cider-refresh')."
(defun cider-connection-browser ()
"Open a browser buffer for nREPL connections."
(interactive)
- (if-let ((buffer (get-buffer cider--connection-browser-buffer-name)))
+ (if-let* ((buffer (get-buffer cider--connection-browser-buffer-name)))
(progn
(cider--connections-refresh-buffer buffer)
(unless (get-buffer-window buffer)
@@ -428,7 +428,7 @@ connection but can be invoked from any buffer (like `cider-refresh')."
"Refresh the connections buffer, if the buffer exists.
The connections buffer is determined by
`cider--connection-browser-buffer-name'"
- (when-let ((buffer (get-buffer cider--connection-browser-buffer-name)))
+ (when-let* ((buffer (get-buffer cider--connection-browser-buffer-name)))
(cider--connections-refresh-buffer buffer)))
(add-hook 'nrepl-disconnected-hook #'cider--connections-refresh)
@@ -620,7 +620,7 @@ REPL's ns, otherwise fall back to \"user\".
When NO-DEFAULT is non-nil, it will return nil instead of \"user\"."
(or cider-buffer-ns
(clojure-find-ns)
- (when-let ((repl-buf (cider-current-connection)))
+ (when-let* ((repl-buf (cider-current-connection)))
(buffer-local-value 'cider-buffer-ns repl-buf))
(if no-default nil "user")))
@@ -833,7 +833,7 @@ unless ALL is truthy."
"Find the definition of VAR, optionally at a specific LINE.
Display the results in a different window."
- (if-let ((info (cider-var-info var)))
+ (if-let* ((info (cider-var-info var)))
(progn
(if line (setq info (nrepl-dict-put info "line" line)))
(cider--jump-to-loc-from-info info t))
@@ -841,7 +841,7 @@ Display the results in a different window."
(defun cider--find-var (var &optional line)
"Find the definition of VAR, optionally at a specific LINE."
- (if-let ((info (cider-var-info var)))
+ (if-let* ((info (cider-var-info var)))
(progn
(if line (setq info (nrepl-dict-put info "line" line)))
(cider--jump-to-loc-from-info info))
@@ -929,11 +929,11 @@ Optional arguments include SEARCH-NS, DOCS-P, PRIVATES-P, CASE-SENSITIVE-P."
(defun cider-sync-request:complete (str context)
"Return a list of completions for STR using nREPL's \"complete\" op.
CONTEXT represents a completion context for compliment."
- (when-let ((dict (thread-first `("op" "complete"
- "ns" ,(cider-current-ns)
- "symbol" ,str
- "context" ,context)
- (cider-nrepl-send-sync-request nil 'abort-on-input))))
+ (when-let* ((dict (thread-first `("op" "complete"
+ "ns" ,(cider-current-ns)
+ "symbol" ,str
+ "context" ,context)
+ (cider-nrepl-send-sync-request nil 'abort-on-input))))
(nrepl-dict-get dict "completions")))
(defun cider-sync-request:complete-flush-caches ()
@@ -956,22 +956,22 @@ CONTEXT represents a completion context for compliment."
(defun cider-sync-request:eldoc (symbol &optional class member)
"Send \"eldoc\" op with parameters SYMBOL or CLASS and MEMBER."
- (when-let ((eldoc (thread-first `("op" "eldoc"
- "ns" ,(cider-current-ns)
- ,@(when symbol `("symbol" ,symbol))
- ,@(when class `("class" ,class))
- ,@(when member `("member" ,member)))
- (cider-nrepl-send-sync-request nil 'abort-on-input))))
+ (when-let* ((eldoc (thread-first `("op" "eldoc"
+ "ns" ,(cider-current-ns)
+ ,@(when symbol `("symbol" ,symbol))
+ ,@(when class `("class" ,class))
+ ,@(when member `("member" ,member)))
+ (cider-nrepl-send-sync-request nil 'abort-on-input))))
(if (member "no-eldoc" (nrepl-dict-get eldoc "status"))
nil
eldoc)))
(defun cider-sync-request:eldoc-datomic-query (symbol)
"Send \"eldoc-datomic-query\" op with parameter SYMBOL."
- (when-let ((eldoc (thread-first `("op" "eldoc-datomic-query"
- "ns" ,(cider-current-ns)
- ,@(when symbol `("symbol" ,symbol)))
- (cider-nrepl-send-sync-request nil 'abort-on-input))))
+ (when-let* ((eldoc (thread-first `("op" "eldoc-datomic-query"
+ "ns" ,(cider-current-ns)
+ ,@(when symbol `("symbol" ,symbol)))
+ (cider-nrepl-send-sync-request nil 'abort-on-input))))
(if (member "no-eldoc" (nrepl-dict-get eldoc "status"))
nil
eldoc)))
diff --git a/cider-common.el b/cider-common.el
index 053100d7..d0fedb3a 100644
--- a/cider-common.el
+++ b/cider-common.el
@@ -192,14 +192,14 @@ relative, it is expanded within each of the open Clojure buffers till an
existing file ending with URL has been found."
(require 'arc-mode)
(cond ((string-match "^file:\\(.+\\)" url)
- (when-let ((file (cider--url-to-file (match-string 1 url)))
- (path (cider--file-path file)))
+ (when-let* ((file (cider--url-to-file (match-string 1 url)))
+ (path (cider--file-path file)))
(find-file-noselect path)))
((string-match "^\\(jar\\|zip\\):\\(file:.+\\)!/\\(.+\\)" url)
- (when-let ((entry (match-string 3 url))
- (file (cider--url-to-file (match-string 2 url)))
- (path (cider--file-path file))
- (name (format "%s:%s" path entry)))
+ (when-let* ((entry (match-string 3 url))
+ (file (cider--url-to-file (match-string 2 url)))
+ (path (cider--file-path file))
+ (name (format "%s:%s" path entry)))
(or (find-buffer-visiting name)
(if (tramp-tramp-file-p path)
(progn
@@ -223,7 +223,7 @@ existing file ending with URL has been found."
(set-buffer-modified-p nil)
(set-auto-mode)
(current-buffer))))))
- (t (if-let ((path (cider--file-path url)))
+ (t (if-let* ((path (cider--file-path url)))
(find-file-noselect path)
(unless (file-name-absolute-p url)
(let ((cider-buffers (cider-util--clojure-buffers))
diff --git a/cider-compat.el b/cider-compat.el
index 7387f833..4debff12 100644
--- a/cider-compat.el
+++ b/cider-compat.el
@@ -125,8 +125,8 @@ threading."
(eval-and-compile
- (unless (fboundp 'if-let)
- (defmacro if-let (bindings then &rest else)
+ (unless (fboundp 'if-let*)
+ (defmacro if-let* (bindings then &rest else)
"Process BINDINGS and if all values are non-nil eval THEN, else ELSE.
Argument BINDINGS is a list of tuples whose car is a symbol to be
bound and (optionally) used in THEN, and its cadr is a sexp to be
@@ -143,15 +143,15 @@ to bind a single value, BINDINGS can just be a plain tuple."
,then
,@else))))
- (unless (fboundp 'when-let)
- (defmacro when-let (bindings &rest body)
+ (unless (fboundp 'when-let*)
+ (defmacro when-let* (bindings &rest body)
"Process BINDINGS and if all values are non-nil eval BODY.
Argument BINDINGS is a list of tuples whose car is a symbol to be
bound and (optionally) used in BODY, and its cadr is a sexp to be
evalled to set symbol's value. In the special case you only want
to bind a single value, BINDINGS can just be a plain tuple."
- (declare (indent 1) (debug if-let))
- `(if-let ,bindings ,(macroexp-progn body)))))
+ (declare (indent 1) (debug if-let*))
+ `(if-let* ,bindings ,(macroexp-progn body)))))
(eval-and-compile
diff --git a/cider-debug.el b/cider-debug.el
index 3bb9f784..4e49ff09 100644
--- a/cider-debug.el
+++ b/cider-debug.el
@@ -122,8 +122,8 @@ This variable must be set before starting the repl connection."
(defun cider-browse-instrumented-defs ()
"List all instrumented definitions."
(interactive)
- (if-let ((all (thread-first (cider-nrepl-send-sync-request '("op" "debug-instrumented-defs"))
- (nrepl-dict-get "list"))))
+ (if-let* ((all (thread-first (cider-nrepl-send-sync-request '("op" "debug-instrumented-defs"))
+ (nrepl-dict-get "list"))))
(with-current-buffer (cider-popup-buffer cider-browse-ns-buffer t)
(let ((inhibit-read-only t))
(erase-buffer)
@@ -230,7 +230,7 @@ Each element of LOCALS should be a list of at least two elements."
(format (propertize "%s\n" 'face 'default)
(string-join
(nrepl-dict-map (lambda (char cmd)
- (when-let ((pos (cl-search char cmd)))
+ (when-let* ((pos (cl-search char cmd)))
(put-text-property pos (1+ pos) 'face 'cider-debug-prompt-face cmd))
cmd)
command-dict)
@@ -343,8 +343,8 @@ In order to work properly, this mode must be activated by
;; We wait a moment before clearing overlays and the read-onlyness, so that
;; cider-nrepl has a chance to send the next message, and so that the user
;; doesn't accidentally hit `n' between two messages (thus editing the code).
- (when-let ((proc (unless nrepl-ongoing-sync-request
- (get-buffer-process (cider-current-connection)))))
+ (when-let* ((proc (unless nrepl-ongoing-sync-request
+ (get-buffer-process (cider-current-connection)))))
(accept-process-output proc 1))
(unless cider--debug-mode
(setq buffer-read-only nil)
@@ -443,7 +443,7 @@ Return trimmed CODE."
ID is the id of the message that instrumented CODE.
REASON is a keyword describing why this buffer was necessary."
(let ((buffer-name (format cider--debug-buffer-format id)))
- (if-let ((buffer (get-buffer buffer-name)))
+ (if-let* ((buffer (get-buffer buffer-name)))
(cider-popup-buffer-display buffer 'select)
(with-current-buffer (cider-popup-buffer buffer-name 'select
#'clojure-mode 'ancillary)
@@ -465,7 +465,7 @@ REASON is a keyword describing why this buffer was necessary."
(defun cider--debug-goto-keyval (key)
"Find KEY in current sexp or return nil."
- (when-let ((limit (ignore-errors (save-excursion (up-list) (point)))))
+ (when-let* ((limit (ignore-errors (save-excursion (up-list) (point)))))
(search-forward-regexp (concat "\\_<" (regexp-quote key) "\\_>")
limit 'noerror)))
@@ -580,9 +580,9 @@ is a coordinate measure in sexps."
(save-excursion
(let ((out))
;; We prefer in-source debugging.
- (when-let ((buf (and file line column
- (ignore-errors
- (cider--find-buffer-for-file file)))))
+ (when-let* ((buf (and file line column
+ (ignore-errors
+ (cider--find-buffer-for-file file)))))
;; The logic here makes it hard to use `with-current-buffer'.
(with-current-buffer buf
;; This is for restoring point inside buf.
@@ -648,7 +648,7 @@ needed. It is expected to contain at least \"key\", \"input-type\", and
RESPONSE is a message received from the nrepl describing the value and
coordinates of a sexp. Create an overlay after the specified sexp
displaying its value."
- (when-let ((marker (cider--debug-find-source-position response)))
+ (when-let* ((marker (cider--debug-find-source-position response)))
(with-current-buffer (marker-buffer marker)
(save-excursion
(goto-char marker)
diff --git a/cider-doc.el b/cider-doc.el
index 7b33fc76..52a953a0 100644
--- a/cider-doc.el
+++ b/cider-doc.el
@@ -226,8 +226,8 @@ opposite of what that option dictates."
"Open the source for the current symbol, if available."
(interactive)
(if cider-docview-file
- (if-let ((buffer (and (not (cider--tooling-file-p cider-docview-file))
- (cider-find-file cider-docview-file))))
+ (if-let* ((buffer (and (not (cider--tooling-file-p cider-docview-file))
+ (cider-find-file cider-docview-file))))
(cider-jump-to buffer (if cider-docview-line
(cons cider-docview-line nil)
cider-docview-symbol)
@@ -262,12 +262,12 @@ opposite of what that option dictates."
(defun cider-create-doc-buffer (symbol)
"Populates *cider-doc* with the documentation for SYMBOL."
- (when-let ((info (cider-var-info symbol)))
+ (when-let* ((info (cider-var-info symbol)))
(cider-docview-render (cider-make-popup-buffer cider-doc-buffer) symbol info)))
(defun cider-doc-lookup (symbol)
"Look up documentation for SYMBOL."
- (if-let ((buffer (cider-create-doc-buffer symbol)))
+ (if-let* ((buffer (cider-create-doc-buffer symbol)))
(cider-popup-buffer-display buffer cider-doc-auto-select-buffer)
(user-error "Symbol %s not resolved" symbol)))
@@ -396,9 +396,9 @@ Tables are marked to be ignored by line wrap."
(depr (nrepl-dict-get info "deprecated"))
(macro (nrepl-dict-get info "macro"))
(special (nrepl-dict-get info "special-form"))
- (forms (when-let ((str (nrepl-dict-get info "forms-str")))
+ (forms (when-let* ((str (nrepl-dict-get info "forms-str")))
(split-string str "\n")))
- (args (when-let ((str (nrepl-dict-get info "arglists-str")))
+ (args (when-let* ((str (nrepl-dict-get info "arglists-str")))
(split-string str "\n")))
(doc (or (nrepl-dict-get info "doc")
"Not documented."))
@@ -428,7 +428,7 @@ Tables are marked to be ignored by line wrap."
(emit (concat " "(cider-font-lock-as 'java-mode iface)))))
(when (or super ifaces)
(insert "\n"))
- (when-let ((forms (or forms args)))
+ (when-let* ((forms (or forms args)))
(dolist (form forms)
(insert " ")
(emit (cider-font-lock-as-clojure form))))
diff --git a/cider-eldoc.el b/cider-eldoc.el
index 58422977..fca6a486 100644
--- a/cider-eldoc.el
+++ b/cider-eldoc.el
@@ -101,8 +101,8 @@ CLASS-NAMES is a list of classes to which a Java interop form belongs.
Only keep the first `cider-eldoc-max-class-names-to-display' names, and
add a \"& x more\" suffix. Return nil if the CLASS-NAMES list is empty or
mapping `cider-eldoc-ns-function' on it returns an empty list."
- (when-let ((eldoc-class-names (seq-remove #'null (mapcar (apply-partially cider-eldoc-ns-function) class-names)))
- (eldoc-class-names-length (length eldoc-class-names)))
+ (when-let* ((eldoc-class-names (seq-remove #'null (mapcar (apply-partially cider-eldoc-ns-function) class-names)))
+ (eldoc-class-names-length (length eldoc-class-names)))
(cond
;; truncate class-names list and then format it
((and cider-eldoc-max-class-names-to-display
@@ -130,13 +130,13 @@ THING represents the thing at point which triggered eldoc. Normally NS and
SYMBOL are used (they are derived from THING), but when empty we fallback to
THING (e.g. for Java methods). Format it as a function, if FUNCTION-P
is non-nil. Else format it as a variable."
- (if-let ((method-name (if (and symbol (not (string= symbol "")))
- symbol
- thing))
- (propertized-method-name (cider-propertize method-name type))
- (ns-or-class (if (and ns (stringp ns))
- (funcall cider-eldoc-ns-function ns)
- (cider--eldoc-format-class-names ns))))
+ (if-let* ((method-name (if (and symbol (not (string= symbol "")))
+ symbol
+ thing))
+ (propertized-method-name (cider-propertize method-name type))
+ (ns-or-class (if (and ns (stringp ns))
+ (funcall cider-eldoc-ns-function ns)
+ (cider--eldoc-format-class-names ns))))
(format "%s/%s"
;; we set font-lock properties of classes in `cider--eldoc-format-class-names'
;; to avoid font locking the parentheses and "& x more"
@@ -320,8 +320,8 @@ Then go back to the point and return its eldoc."
(cider-eldoc-beginning-of-sexp)
(unless (member (or (char-before (point)) 0) '(?\" ?\{ ?\[))
(goto-char current-point)
- (when-let (eldoc-info (cider-eldoc-info
- (cider--eldoc-remove-dot (cider-symbol-at-point))))
+ (when-let* ((eldoc-info (cider-eldoc-info
+ (cider--eldoc-remove-dot (cider-symbol-at-point)))))
`("eldoc-info" ,eldoc-info
"thing" ,(cider-symbol-at-point)
"pos" 0)))))))
@@ -329,14 +329,14 @@ Then go back to the point and return its eldoc."
(defun cider-eldoc-info-at-sexp-beginning ()
"Return eldoc info for first symbol in the sexp."
(save-excursion
- (when-let ((beginning-of-sexp (cider-eldoc-beginning-of-sexp))
- ;; If we are at the beginning of function name, this will be -1
- (argument-index (max 0 (1- beginning-of-sexp))))
+ (when-let* ((beginning-of-sexp (cider-eldoc-beginning-of-sexp))
+ ;; If we are at the beginning of function name, this will be -1
+ (argument-index (max 0 (1- beginning-of-sexp))))
(unless (or (memq (or (char-before (point)) 0)
'(?\" ?\{ ?\[))
(cider-in-comment-p))
- (when-let (eldoc-info (cider-eldoc-info
- (cider--eldoc-remove-dot (cider-symbol-at-point))))
+ (when-let* ((eldoc-info (cider-eldoc-info
+ (cider--eldoc-remove-dot (cider-symbol-at-point)))))
`("eldoc-info" ,eldoc-info
"thing" ,(cider-symbol-at-point)
"pos" ,argument-index))))))
@@ -388,7 +388,7 @@ This includes the arglist and ns and symbol name (if available)."
;; generic case
(t (if (equal thing (car cider-eldoc-last-symbol))
(cadr cider-eldoc-last-symbol)
- (when-let ((eldoc-info (cider-sync-request:eldoc thing)))
+ (when-let* ((eldoc-info (cider-sync-request:eldoc thing)))
(let* ((arglists (nrepl-dict-get eldoc-info "eldoc"))
(docstring (nrepl-dict-get eldoc-info "docstring"))
(type (nrepl-dict-get eldoc-info "type"))
@@ -409,7 +409,7 @@ This includes the arglist and ns and symbol name (if available)."
"type" type)))
;; add context dependent args if requested by defcustom
;; do not cache this eldoc info to avoid showing info
- ;: of the previous context
+ ;: of the previous context
(if cider-eldoc-display-context-dependent-info
(cond
;; add inputs of datomic query
diff --git a/cider-grimoire.el b/cider-grimoire.el
index 8dc61733..959f99ea 100644
--- a/cider-grimoire.el
+++ b/cider-grimoire.el
@@ -58,7 +58,7 @@
(defun cider-grimoire-web-lookup (symbol)
"Open the grimoire documentation for SYMBOL in a web browser."
- (if-let ((var-info (cider-var-info symbol)))
+ (if-let* ((var-info (cider-var-info symbol)))
(let ((name (nrepl-dict-get var-info "name"))
(ns (nrepl-dict-get var-info "ns")))
(browse-url (cider-grimoire-url name ns)))
@@ -95,7 +95,7 @@ opposite of what that option dictates."
If SYMBOL is a special form, the clojure.core ns is used, as is
Grimoire's convention."
- (if-let ((var-info (cider-var-info symbol)))
+ (if-let* ((var-info (cider-var-info symbol)))
(let ((name (nrepl-dict-get var-info "name"))
(ns (nrepl-dict-get var-info "ns" "clojure.core"))
(url-request-method "GET")
diff --git a/cider-inspector.el b/cider-inspector.el
index 95eac986..920d7e58 100644
--- a/cider-inspector.el
+++ b/cider-inspector.el
@@ -142,7 +142,7 @@ Interactively, EXPR is read from the minibuffer, and NS the
current buffer's namespace."
(interactive (list (cider-read-from-minibuffer "Inspect expression: " (cider-sexp-at-point))
(cider-current-ns)))
- (when-let (value (cider-sync-request:inspect-expr expr ns (or cider-inspector-page-size 32)))
+ (when-let* ((value (cider-sync-request:inspect-expr expr ns (or cider-inspector-page-size 32)))
(cider-inspector--render-value value)))
(defun cider-inspector-pop ()
@@ -150,21 +150,21 @@ current buffer's namespace."
See `cider-sync-request:inspect-pop' and `cider-inspector--render-value'."
(interactive)
(setq cider-inspector-last-command 'cider-inspector-pop)
- (when-let (value (cider-sync-request:inspect-pop))
+ (when-let* ((value (cider-sync-request:inspect-pop))
(cider-inspector--render-value value)))
(defun cider-inspector-push (idx)
"Inspect the value at IDX in the inspector stack and render it.
See `cider-sync-request:insepect-push' and `cider-inspector--render-value'"
(push (point) cider-inspector-location-stack)
- (when-let (value (cider-sync-request:inspect-push idx))
+ (when-let* ((value (cider-sync-request:inspect-push idx))
(cider-inspector--render-value value)))
(defun cider-inspector-refresh ()
"Re-render the currently inspected value.
See `cider-sync-request:insepect-refresh' and `cider-inspector--render-value'"
(interactive)
- (when-let (value (cider-sync-request:inspect-refresh))
+ (when-let* ((value (cider-sync-request:inspect-refresh))
(cider-inspector--render-value value)))
(defun cider-inspector-next-page ()
@@ -173,7 +173,7 @@ See `cider-sync-request:insepect-refresh' and `cider-inspector--render-value'"
Does nothing if already on the last page."
(interactive)
(push (point) cider-inspector-page-location-stack)
- (when-let (value (cider-sync-request:inspect-next-page))
+ (when-let* ((value (cider-sync-request:inspect-next-page))
(cider-inspector--render-value value)))
(defun cider-inspector-prev-page ()
@@ -182,7 +182,7 @@ Does nothing if already on the last page."
Does nothing if already on the first page."
(interactive)
(setq cider-inspector-last-command 'cider-inspector-prev-page)
- (when-let (value (cider-sync-request:inspect-prev-page))
+ (when-let* ((value (cider-sync-request:inspect-prev-page))
(cider-inspector--render-value value)))
(defun cider-inspector-set-page-size (page-size)
@@ -190,7 +190,7 @@ Does nothing if already on the first page."
Current page will be reset to zero."
(interactive "nPage size: ")
- (when-let (value (cider-sync-request:inspect-set-page-size page-size))
+ (when-let* ((value (cider-sync-request:inspect-set-page-size page-size))
(cider-inspector--render-value value)))
;; nREPL interactions
diff --git a/cider-interaction.el b/cider-interaction.el
index 0c0a1f15..3f24fe5a 100644
--- a/cider-interaction.el
+++ b/cider-interaction.el
@@ -334,7 +334,7 @@ When invoked with a prefix ARG the command doesn't prompt for confirmation."
(defun cider--quit-error-window ()
"Buries the `cider-error-buffer' and quits its containing window."
- (when-let ((error-win (get-buffer-window cider-error-buffer)))
+ (when-let* ((error-win (get-buffer-window cider-error-buffer)))
(quit-window nil error-win)))
;;;
@@ -410,12 +410,12 @@ A default value of thing at point is given when prompted."
CALLBACK upon failure to invoke prompt if not prompted previously.
Show results in a different window if OTHER-WINDOW is true."
- (if-let ((info (cider-var-info symbol-file)))
+ (if-let* ((info (cider-var-info symbol-file)))
(cider--jump-to-loc-from-info info other-window)
(progn
(cider-ensure-op-supported "resource")
- (if-let ((resource (cider-sync-request:resource symbol-file))
- (buffer (cider-find-file resource)))
+ (if-let* ((resource (cider-sync-request:resource symbol-file))
+ (buffer (cider-find-file resource)))
(cider-jump-to buffer 0 other-window)
(if (cider--prompt-for-symbol-p current-prefix-arg)
(error "Resource or var %s not resolved" symbol-file)
@@ -448,8 +448,8 @@ value is thing at point."
(cider-ensure-op-supported "resource")
(when (= (length path) 0)
(error "Cannot find resource for empty path"))
- (if-let ((resource (cider-sync-request:resource path))
- (buffer (cider-find-file resource)))
+ (if-let* ((resource (cider-sync-request:resource path))
+ (buffer (cider-find-file resource)))
(cider-jump-to buffer nil (cider--open-other-window-p current-prefix-arg))
(if (cider--prompt-for-symbol-p current-prefix-arg)
(error "Cannot find resource %s" path)
@@ -486,7 +486,7 @@ Invert meaning of `cider-prompt-for-symbol' if PREFIX indicates it should be."
(defun cider--find-ns (ns &optional other-window)
"Find the file containing NS's definition.
Optionally open it in a different window if OTHER-WINDOW is truthy."
- (if-let ((path (cider-sync-request:ns-path ns)))
+ (if-let* ((path (cider-sync-request:ns-path ns)))
(cider-jump-to (cider-find-file path) nil other-window)
(user-error "Can't find %s" ns)))
@@ -602,7 +602,7 @@ The formatting is performed by `cider-annotate-completion-function'."
(defun cider-complete-at-point ()
"Complete the symbol at point."
- (when-let ((bounds (bounds-of-thing-at-point 'symbol)))
+ (when-let* ((bounds (bounds-of-thing-at-point 'symbol)))
(when (and (cider-connected-p)
(not (or (cider-in-string-p) (cider-in-comment-p))))
(list (car bounds) (cdr bounds)
@@ -626,7 +626,7 @@ has started."
Returns the cons of the buffer itself and the location of VAR's definition
in the buffer."
- (when-let ((info (cider-var-info var))
+ (when-let* ((info (cider-var-info var))
(file (nrepl-dict-get info "file"))
(line (nrepl-dict-get info "line"))
(buffer (cider-find-file file)))
@@ -857,7 +857,7 @@ This is used by pretty-printing commands and intentionally discards their result
(defun cider-visit-error-buffer ()
"Visit the `cider-error-buffer' (usually *cider-error*) if it exists."
(interactive)
- (if-let ((buffer (get-buffer cider-error-buffer)))
+ (if-let* ((buffer (get-buffer cider-error-buffer)))
(cider-popup-buffer-display buffer cider-auto-select-error-buffer)
(user-error "No %s buffer" cider-error-buffer)))
@@ -1035,7 +1035,7 @@ If location could not be found, return nil."
(col (nth 2 info)))
(unless (or (not (stringp file))
(cider--tooling-file-p file))
- (when-let ((buffer (cider-find-file file)))
+ (when-let* ((buffer (cider-find-file file)))
(with-current-buffer buffer
(save-excursion
(save-restriction
@@ -1053,9 +1053,9 @@ If location could not be found, return nil."
"Highlight and jump to compilation error extracted from MESSAGE.
EVAL-BUFFER is the buffer that was current during user's interactive
evaluation command. Honor `cider-auto-jump-to-error'."
- (when-let ((loc (cider--find-last-error-location message))
- (overlay (make-overlay (nth 0 loc) (nth 1 loc) (nth 2 loc)))
- (info (cider-extract-error-info cider-compilation-regexp message)))
+ (when-let* ((loc (cider--find-last-error-location message))
+ (overlay (make-overlay (nth 0 loc) (nth 1 loc) (nth 2 loc)))
+ (info (cider-extract-error-info cider-compilation-regexp message)))
(let* ((face (nth 3 info))
(note (nth 4 info))
(auto-jump (if (eq cider-auto-jump-to-error 'errors-only)
@@ -1076,7 +1076,7 @@ evaluation command. Honor `cider-auto-jump-to-error'."
;; configuration (https://github.com/clojure-emacs/cider/issues/847). In
;; that case we don't jump at all in order to avoid covering *cider-error*
;; buffer.
- (when-let ((win (get-buffer-window eval-buffer)))
+ (when-let* ((win (get-buffer-window eval-buffer)))
(with-selected-window win
(cider-jump-to (nth 2 loc) (car loc)))))))))
@@ -1628,7 +1628,7 @@ Defaults to the current ns. With prefix arg QUERY, prompts for a ns."
(defun cider-save-project-buffers ()
"Ensure modified project buffers are saved before certain operations.
Its behavior is controlled by `cider-save-files-on-cider-refresh'."
- (when-let ((project-root (clojure-project-dir)))
+ (when-let* ((project-root (clojure-project-dir)))
(when cider-save-files-on-cider-refresh
(save-some-buffers
(eq cider-save-files-on-cider-refresh t)
@@ -1743,7 +1743,7 @@ The heavy lifting is done by `cider-load-buffer'."
(when (buffer-file-name)
(file-name-nondirectory
(buffer-file-name))))))
- (if-let ((buffer (find-buffer-visiting filename)))
+ (if-let* ((buffer (find-buffer-visiting filename)))
(cider-load-buffer buffer)
(find-file filename)
(cider-load-buffer (current-buffer))))
@@ -1877,7 +1877,7 @@ START and END represent the region's boundaries."
"Close the BUFFER and kill its associated process (if any)."
(when (buffer-live-p buffer)
(with-current-buffer buffer
- (when-let ((proc (get-buffer-process buffer)))
+ (when-let* ((proc (get-buffer-process buffer)))
(when (process-live-p proc)
(when (or (not nrepl-server-buffer)
;; Sync request will hang if the server is dead.
@@ -1908,7 +1908,7 @@ and all ancillary CIDER buffers."
(cider-ensure-connected)
(if (and quit-all (y-or-n-p "Are you sure you want to quit all CIDER connections? "))
(progn
- (when-let ((scratch (get-buffer cider-scratch-buffer-name)))
+ (when-let* ((scratch (get-buffer cider-scratch-buffer-name)))
(when (y-or-n-p (format "Kill %s buffer? " cider-scratch-buffer-name))
(kill-buffer cider-scratch-buffer-name)))
(dolist (connection cider-connections)
@@ -1978,10 +1978,10 @@ With a prefix argument, prompt for function to run instead of -main."
(interactive (list (when current-prefix-arg (read-string "Function name: "))))
(cider-ensure-connected)
(let ((name (or function "-main")))
- (when-let ((response (cider-nrepl-send-sync-request
- `("op" "ns-list-vars-by-name"
- "name" ,name))))
- (if-let ((vars (split-string (substring (nrepl-dict-get response "var-list") 1 -1))))
+ (when-let* ((response (cider-nrepl-send-sync-request
+ `("op" "ns-list-vars-by-name"
+ "name" ,name))))
+ (if-let* ((vars (split-string (substring (nrepl-dict-get response "var-list") 1 -1))))
(cider-interactive-eval
(if (= (length vars) 1)
(concat "(" (car vars) ")")
diff --git a/cider-macroexpansion.el b/cider-macroexpansion.el
index 82ba966d..6f0dab54 100644
--- a/cider-macroexpansion.el
+++ b/cider-macroexpansion.el
@@ -89,7 +89,7 @@ This variable specifies both what was expanded and the expander.")
(defun cider-macroexpand-expr (expander expr)
"Macroexpand, use EXPANDER, the given EXPR."
- (when-let ((expansion (cider-sync-request:macroexpand expander expr)))
+ (when-let* ((expansion (cider-sync-request:macroexpand expander expr)))
(setq cider-last-macroexpand-expression expr)
(cider-initialize-macroexpansion-buffer expansion (cider-current-ns))))
diff --git a/cider-mode.el b/cider-mode.el
index a7e15e39..ff5fbc15 100644
--- a/cider-mode.el
+++ b/cider-mode.el
@@ -50,7 +50,7 @@
"Return info for the `cider-mode' modeline.
Info contains project name and host:port endpoint."
- (if-let ((current-connection (ignore-errors (cider-current-connection))))
+ (if-let* ((current-connection (ignore-errors (cider-current-connection))))
(with-current-buffer current-connection
(concat
cider-repl-type
@@ -377,9 +377,9 @@ re-visited."
(defun cider--get-symbol-indent (symbol-name)
"Return the indent metadata for SYMBOL-NAME in the current namespace."
(let* ((ns (cider-current-ns)))
- (if-let ((meta (cider-resolve-var ns symbol-name))
- (indent (or (nrepl-dict-get meta "style/indent")
- (nrepl-dict-get meta "indent"))))
+ (if-let* ((meta (cider-resolve-var ns symbol-name))
+ (indent (or (nrepl-dict-get meta "style/indent")
+ (nrepl-dict-get meta "indent"))))
(let ((format (format ":indent metadata on ā€˜%sā€™ is unreadable! \nERROR: %%s"
symbol-name)))
(with-demoted-errors format
@@ -387,9 +387,9 @@ re-visited."
;; There's no indent metadata, but there might be a clojure-mode
;; indent-spec with fully-qualified namespace.
(when (string-match cider-resolve--prefix-regexp symbol-name)
- (when-let ((sym (intern-soft (replace-match (save-match-data
- (cider-resolve-alias ns (match-string 1 symbol-name)))
- t t symbol-name 1))))
+ (when-let* ((sym (intern-soft (replace-match (save-match-data
+ (cider-resolve-alias ns (match-string 1 symbol-name)))
+ t t symbol-name 1))))
(get sym 'clojure-indent-function))))))
@@ -629,8 +629,8 @@ namespace itself."
(when (and cider-font-lock-dynamically
font-lock-mode)
(font-lock-remove-keywords nil cider--dynamic-font-lock-keywords)
- (when-let ((ns (or ns (cider-current-ns)))
- (symbols (cider-resolve-ns-symbols ns)))
+ (when-let* ((ns (or ns (cider-current-ns)))
+ (symbols (cider-resolve-ns-symbols ns)))
(setq-local cider--dynamic-font-lock-keywords
(cider--compile-font-lock-keywords
symbols (cider-resolve-ns-symbols (cider-resolve-core-ns))))
@@ -790,7 +790,7 @@ See \(info \"(elisp) Special Properties\")"
(ignore-errors
(save-excursion
(goto-char pos)
- (when-let ((sym (cider-symbol-at-point)))
+ (when-let* ((sym (cider-symbol-at-point)))
(if (member sym (get-text-property (point) 'cider-locals))
(concat (format "`%s' is a local" sym)
(when cider--debug-mode
diff --git a/cider-overlays.el b/cider-overlays.el
index 731088ff..8345e283 100644
--- a/cider-overlays.el
+++ b/cider-overlays.el
@@ -239,7 +239,7 @@ overlay."
#'cider--remove-result-overlay-after-command
nil 'local)
(cider--remove-result-overlay-after-command))))
- (when-let ((win (get-buffer-window buffer)))
+ (when-let* ((win (get-buffer-window buffer)))
;; Left edge is visible.
(when (and (<= (window-start win) (point))
;; In 24.3 `<=' is still a binary perdicate.
diff --git a/cider-repl-history.el b/cider-repl-history.el
index 6a9cdfec..834aff2e 100644
--- a/cider-repl-history.el
+++ b/cider-repl-history.el
@@ -426,7 +426,7 @@ text is still inserted at the end."
(defun cider-repl-history-update-highlighed-entry ()
"Update highlighted entry, when feature is turned on."
(when cider-repl-history-highlight-current-entry
- (if-let ((current-overlay (cider-repl-history-target-overlay-at (point) t)))
+ (if-let* ((current-overlay (cider-repl-history-target-overlay-at (point) t)))
(unless (equal cider-repl-history-previous-overlay current-overlay)
;; We've changed overlay. Clear current highlighting,
;; and highlight the new overlay.
diff --git a/cider-repl.el b/cider-repl.el
index 99d6398e..367c68c0 100644
--- a/cider-repl.el
+++ b/cider-repl.el
@@ -219,11 +219,11 @@ via `cider-current-connection'.")
;; Metadata changed, so signatures may have changed too.
(setq cider-eldoc-last-symbol nil)
(when (or cider-mode (derived-mode-p 'cider-repl-mode))
- (when-let ((ns-dict (or (nrepl-dict-get changed-namespaces (cider-current-ns))
- (let ((ns-dict (cider-resolve--get-in (cider-current-ns))))
- (when (seq-find (lambda (ns) (nrepl-dict-get changed-namespaces ns))
- (nrepl-dict-get ns-dict "aliases"))
- ns-dict)))))
+ (when-let* ((ns-dict (or (nrepl-dict-get changed-namespaces (cider-current-ns))
+ (let ((ns-dict (cider-resolve--get-in (cider-current-ns))))
+ (when (seq-find (lambda (ns) (nrepl-dict-get changed-namespaces ns))
+ (nrepl-dict-get ns-dict "aliases"))
+ ns-dict)))))
(cider-refresh-dynamic-font-lock ns-dict))))))))))
(declare-function cider-default-err-handler "cider-interaction")
@@ -562,7 +562,7 @@ When there is a possible unfinished ansi control sequence,
(defun cider-repl--ns-form-changed-p (ns-form connection)
"Return non-nil if NS-FORM for CONNECTION changed since last eval."
- (when-let ((ns (cider-ns-from-form ns-form)))
+ (when-let* ((ns (cider-ns-from-form ns-form)))
(not (string= ns-form
(lax-plist-get
(buffer-local-value 'cider-repl--ns-forms-plist connection)
@@ -580,7 +580,7 @@ When there is a possible unfinished ansi control sequence,
(defun cider-repl--cache-ns-form (ns-form connection)
"Given NS-FORM cache root ns in CONNECTION."
(with-current-buffer connection
- (when-let ((ns (cider-ns-from-form ns-form)))
+ (when-let* ((ns (cider-ns-from-form ns-form)))
;; cache ns-form
(setq cider-repl--ns-forms-plist
(lax-plist-put cider-repl--ns-forms-plist ns ns-form))
@@ -901,7 +901,7 @@ text property `cider-old-input'."
(defun cider-repl-switch-to-other ()
"Switch between the Clojure and ClojureScript REPLs for the current project."
(interactive)
- (if-let (other-connection (cider-other-connection))
+ (if-let* ((other-connection (cider-other-connection))
(switch-to-buffer other-connection)
(message "There's no other REPL for the current project")))
@@ -1073,7 +1073,7 @@ for locref look up."
This function is used from help-echo property inside REPL buffers and uses
regexes from `cider-locref-regexp-alist' to infer locations at point."
(interactive)
- (if-let ((loc (cider-locref-at-point pos)))
+ (if-let* ((loc (cider-locref-at-point pos)))
(let* ((var (plist-get loc :var))
(line (plist-get loc :line))
(file (or
@@ -1108,7 +1108,7 @@ One for all REPLs.")
"Function for help-echo property in REPL buffers.
WIN, BUFFER and POS are the window, buffer and point under mouse position."
(with-current-buffer buffer
- (if-let ((hl (plist-get (cider-locref-at-point pos) :highlight)))
+ (if-let* ((hl (plist-get (cider-locref-at-point pos) :highlight)))
(move-overlay cider-locref-hoover-overlay (car hl) (cdr hl))
(delete-overlay cider-locref-hoover-overlay))
nil))
diff --git a/cider-resolve.el b/cider-resolve.el
index 6f9f8ebf..fa328aff 100644
--- a/cider-resolve.el
+++ b/cider-resolve.el
@@ -95,7 +95,7 @@ Return nil only if VAR cannot be resolved."
(cider-resolve--get-in (or var-ns ns) "interns" name)
(unless var-ns
;; If the var had no prefix, it might be referred.
- (if-let ((referal (cider-resolve--get-in ns "refers" name)))
+ (if-let* ((referal (cider-resolve--get-in ns "refers" name)))
(cider-resolve-var ns referal)
;; Or it might be from core.
(unless (equal ns "clojure.core")
@@ -114,9 +114,9 @@ This will be clojure.core or cljs.core depending on `cider-repl-type'."
"Return a plist of all valid symbols in NS.
Each entry's value is the metadata of the var that the symbol refers to.
NS can be the namespace name, or a dict of the namespace itself."
- (when-let ((dict (if (stringp ns)
- (cider-resolve--get-in ns)
- ns)))
+ (when-let* ((dict (if (stringp ns)
+ (cider-resolve--get-in ns)
+ ns)))
(nrepl-dbind-response dict (interns refers aliases)
(append (cdr interns)
(nrepl-dict-flat-map (lambda (alias namespace)
diff --git a/cider-stacktrace.el b/cider-stacktrace.el
index 1ddb8dac..0b80f63a 100644
--- a/cider-stacktrace.el
+++ b/cider-stacktrace.el
@@ -352,7 +352,7 @@ POS-FILTERS ensure that frames with flag is shown."
(save-excursion
(goto-char (point-min))
(cl-flet ((next-detail (end)
- (when-let ((pos (next-single-property-change (point) 'detail)))
+ (when-let* ((pos (next-single-property-change (point) 'detail)))
(when (< pos end)
(goto-char pos)))))
(let ((inhibit-read-only t))
@@ -402,14 +402,14 @@ grouped with a suppressed error type."
"Move point to the previous exception cause, if one exists."
(interactive)
(with-current-buffer cider-error-buffer
- (when-let ((pos (previous-single-property-change (point) 'cause)))
+ (when-let* ((pos (previous-single-property-change (point) 'cause)))
(goto-char pos))))
(defun cider-stacktrace-next-cause ()
"Move point to the next exception cause, if one exists."
(interactive)
(with-current-buffer cider-error-buffer
- (when-let ((pos (next-single-property-change (point) 'cause)))
+ (when-let* ((pos (next-single-property-change (point) 'cause)))
(goto-char pos))))
(defun cider-stacktrace-cycle-cause (num &optional level)
@@ -441,7 +441,7 @@ When it reaches 3, it wraps to 0."
"Cycle the visibility of current exception at point, if any."
(interactive)
(with-current-buffer cider-error-buffer
- (when-let ((num (get-text-property (point) 'cause)))
+ (when-let* ((num (get-text-property (point) 'cause)))
(cider-stacktrace-cycle-cause num))))
(defun cider-stacktrace-cycle-cause-1 ()
diff --git a/cider-test.el b/cider-test.el
index a23a9bf8..9fe043a8 100644
--- a/cider-test.el
+++ b/cider-test.el
@@ -222,7 +222,7 @@ Add to this list to have CIDER recognize additional test defining macros."
(defun cider-test-show-report ()
"Show the test report buffer, if one exists."
(interactive)
- (if-let ((report-buffer (get-buffer cider-test-report-buffer)))
+ (if-let* ((report-buffer (get-buffer cider-test-report-buffer)))
(switch-to-buffer report-buffer)
(message "No test report buffer")))
@@ -230,20 +230,20 @@ Add to this list to have CIDER recognize additional test defining macros."
"Move point to the previous test result, if one exists."
(interactive)
(with-current-buffer (get-buffer cider-test-report-buffer)
- (when-let ((pos (previous-single-property-change (point) 'type)))
+ (when-let* ((pos (previous-single-property-change (point) 'type)))
(if (get-text-property pos 'type)
(goto-char pos)
- (when-let ((pos (previous-single-property-change pos 'type)))
+ (when-let* ((pos (previous-single-property-change pos 'type)))
(goto-char pos))))))
(defun cider-test-next-result ()
"Move point to the next test result, if one exists."
(interactive)
(with-current-buffer (get-buffer cider-test-report-buffer)
- (when-let ((pos (next-single-property-change (point) 'type)))
+ (when-let* ((pos (next-single-property-change (point) 'type)))
(if (get-text-property pos 'type)
(goto-char pos)
- (when-let ((pos (next-single-property-change pos 'type)))
+ (when-let* ((pos (next-single-property-change pos 'type)))
(goto-char pos))))))
(defun cider-test-jump (&optional arg)
@@ -513,8 +513,8 @@ The optional arg TEST denotes an individual test name."
"Return the buffer visiting the file in which the NS VAR is defined.
Or nil if not found."
(cider-ensure-op-supported "info")
- (when-let ((info (cider-var-info (concat ns "/" var)))
- (file (nrepl-dict-get info "file")))
+ (when-let* ((info (cider-var-info (concat ns "/" var)))
+ (file (nrepl-dict-get info "file")))
(cider-find-file file)))
(defun cider-test-highlight-problems (results)
@@ -523,7 +523,7 @@ Or nil if not found."
(lambda (ns vars)
(nrepl-dict-map
(lambda (var tests)
- (when-let ((buffer (cider-find-var-file ns var)))
+ (when-let* ((buffer (cider-find-var-file ns var)))
(dolist (test tests)
(nrepl-dbind-response test (type)
(unless (equal "pass" type)
@@ -538,7 +538,7 @@ Or nil if not found."
(nrepl-dict-map
(lambda (ns vars)
(dolist (var (nrepl-dict-keys vars))
- (when-let ((buffer (cider-find-var-file ns var)))
+ (when-let* ((buffer (cider-find-var-file ns var)))
(with-current-buffer buffer
(remove-overlays nil nil 'category 'cider-test)))))
cider-test-last-results)))
@@ -657,9 +657,9 @@ If SILENT is non-nil, suppress all messages other then test results.
With a prefix arg SUPPRESS-INFERENCE it will try to run the tests in the
current ns."
(interactive "P")
- (if-let ((ns (if suppress-inference
- (cider-current-ns t)
- (funcall cider-test-infer-test-ns (cider-current-ns t)))))
+ (if-let* ((ns (if suppress-inference
+ (cider-current-ns t)
+ (funcall cider-test-infer-test-ns (cider-current-ns t)))))
(cider-test-execute ns nil silent)
(if (eq major-mode 'cider-test-report-mode)
(when (y-or-n-p (concat "Test report does not define a namespace. "
diff --git a/cider-util.el b/cider-util.el
index 72f3bd34..a9909725 100644
--- a/cider-util.el
+++ b/cider-util.el
@@ -115,7 +115,7 @@ instead."
"Return the name of the symbol at point, otherwise nil.
Ignores the REPL prompt. If LOOK-BACK is non-nil, move backwards trying to
find a symbol if there isn't one at point."
- (or (when-let ((str (thing-at-point 'symbol)))
+ (or (when-let* ((str (thing-at-point 'symbol)))
(unless (text-property-any 0 (length str) 'field 'cider-repl-prompt str)
(substring-no-properties str)))
(when look-back
@@ -131,13 +131,13 @@ find a symbol if there isn't one at point."
"Return the sexp at point as a string, otherwise nil.
If BOUNDS is non-nil, return a list of its starting and ending position
instead."
- (when-let ((b (or (and (equal (char-after) ?\()
- (member (char-before) '(?\' ?\, ?\@))
- ;; hide stuff before ( to avoid quirks with '( etc.
- (save-restriction
- (narrow-to-region (point) (point-max))
- (bounds-of-thing-at-point 'sexp)))
- (bounds-of-thing-at-point 'sexp))))
+ (when-let* ((b (or (and (equal (char-after) ?\()
+ (member (char-before) '(?\' ?\, ?\@))
+ ;; hide stuff before ( to avoid quirks with '( etc.
+ (save-restriction
+ (narrow-to-region (point) (point-max))
+ (bounds-of-thing-at-point 'sexp)))
+ (bounds-of-thing-at-point 'sexp))))
(funcall (if bounds #'list #'buffer-substring-no-properties)
(car b) (cdr b))))
@@ -389,7 +389,7 @@ plugin or dependency with:
(cider-add-to-alist 'cider-jack-in-lein-plugins
\"plugin/artifact-name\" \"THE-NEW-VERSION\")"
(let ((alist (symbol-value symbol)))
- (if-let ((cons (assoc car alist)))
+ (if-let* ((cons (assoc car alist)))
(setcdr cons (list cadr))
(set symbol (cons (list car cadr) alist)))))
diff --git a/cider.el b/cider.el
index fea11d9f..f6dfc0f5 100644
--- a/cider.el
+++ b/cider.el
@@ -512,7 +512,7 @@ it should start a ClojureScript REPL."
(with-current-buffer server-buffer
(save-excursion
(goto-char (point-min))
- (when-let ((url (and (search-forward-regexp "http://localhost:[0-9]+" nil 'noerror)
+ (when-let* ((url (and (search-forward-regexp "http://localhost:[0-9]+" nil 'noerror)
(match-string 0))))
(when (y-or-n-p (format "Visit ā€˜%sā€™ in a browser? " url))
(browse-url url)))))))
@@ -561,7 +561,7 @@ should be the regular Clojure REPL started by the server process filter."
(defun cider--select-zombie-buffer (repl-buffers)
"Return a zombie buffer from REPL-BUFFERS, or nil if none exists."
- (when-let ((zombie-buffs (seq-remove #'get-buffer-process repl-buffers)))
+ (when-let* ((zombie-buffs (seq-remove #'get-buffer-process repl-buffers)))
(when (y-or-n-p
(format "Zombie REPL buffers exist (%s). Reuse? "
(mapconcat #'buffer-name zombie-buffs ", ")))
@@ -579,15 +579,15 @@ and has no process, return it. If the process is alive, ask the user for
confirmation and return 'new/nil for y/n answer respectively. If other
REPL buffers with dead process exist, ask the user if any of those should
be reused."
- (if-let ((repl-buffers (cider-repl-buffers))
- (exact-buff (seq-find
- (lambda (buff)
- (with-current-buffer buff
- (or (and endpoint
- (equal endpoint nrepl-endpoint))
- (and project-directory
- (equal project-directory nrepl-project-dir)))))
- repl-buffers)))
+ (if-let* ((repl-buffers (cider-repl-buffers))
+ (exact-buff (seq-find
+ (lambda (buff)
+ (with-current-buffer buff
+ (or (and endpoint
+ (equal endpoint nrepl-endpoint))
+ (and project-directory
+ (equal project-directory nrepl-project-dir)))))
+ repl-buffers)))
(if (get-buffer-process exact-buff)
(when (y-or-n-p (format "REPL buffer already exists (%s). \
Do you really want to create a new one? "
@@ -632,7 +632,7 @@ own buffer."
(and (null project-dir)
(eq cider-allow-jack-in-without-project 'warn)
(y-or-n-p "Are you sure you want to run `cider-jack-in' without a Clojure project? ")))
- (when-let ((repl-buff (cider-find-reusable-repl-buffer nil project-dir)))
+ (when-let* ((repl-buff (cider-find-reusable-repl-buffer nil project-dir)))
(let ((nrepl-create-client-buffer-function #'cider-repl-create)
(nrepl-use-this-as-repl-buffer repl-buff))
(nrepl-start-server-process
@@ -658,7 +658,7 @@ When the optional param PROJECT-DIR is present, the connection
gets associated with it."
(interactive (cider-select-endpoint))
(setq cider-current-clojure-buffer (current-buffer))
- (when-let ((repl-buff (cider-find-reusable-repl-buffer `(,host ,port) nil)))
+ (when-let* ((repl-buff (cider-find-reusable-repl-buffer `(,host ,port) nil)))
(let* ((nrepl-create-client-buffer-function #'cider-repl-create)
(nrepl-use-this-as-repl-buffer repl-buff)
(conn (process-buffer (nrepl-start-client-process host port))))
@@ -757,7 +757,7 @@ When DIR is non-nil also look for nREPL port files in DIR. Return a list
of list of the form (project-dir port)."
(let* ((paths (cider--running-nrepl-paths))
(proj-ports (mapcar (lambda (d)
- (when-let ((port (and d (nrepl-extract-port (cider--file-path d)))))
+ (when-let* ((port (and d (nrepl-extract-port (cider--file-path d)))))
(list (file-name-nondirectory (directory-file-name d)) port)))
(cons (clojure-project-dir dir) paths))))
(seq-uniq (delq nil proj-ports))))
@@ -810,9 +810,9 @@ choose."
"Find `cider-lein-command' on `exec-path' if possible, or return nil.
In case `default-directory' is non-local we assume the command is available."
- (when-let ((command (or (and (file-remote-p default-directory) cider-lein-command)
- (executable-find cider-lein-command)
- (executable-find (concat cider-lein-command ".bat")))))
+ (when-let* ((command (or (and (file-remote-p default-directory) cider-lein-command)
+ (executable-find cider-lein-command)
+ (executable-find (concat cider-lein-command ".bat")))))
(shell-quote-argument command)))
;; TODO: Implement a check for `cider-boot-command' over tramp
@@ -820,9 +820,9 @@ In case `default-directory' is non-local we assume the command is available."
"Find `cider-boot-command' on `exec-path' if possible, or return nil.
In case `default-directory' is non-local we assume the command is available."
- (when-let ((command (or (and (file-remote-p default-directory) cider-boot-command)
- (executable-find cider-boot-command)
- (executable-find (concat cider-boot-command ".exe")))))
+ (when-let* ((command (or (and (file-remote-p default-directory) cider-boot-command)
+ (executable-find cider-boot-command)
+ (executable-find (concat cider-boot-command ".exe")))))
(shell-quote-argument command)))
;; TODO: Implement a check for `cider-gradle-command' over tramp
@@ -830,9 +830,9 @@ In case `default-directory' is non-local we assume the command is available."
"Find `cider-gradle-command' on `exec-path' if possible, or return nil.
In case `default-directory' is non-local we assume the command is available."
- (when-let ((command (or (and (file-remote-p default-directory) cider-gradle-command)
- (executable-find cider-gradle-command)
- (executable-find (concat cider-gradle-command ".exe")))))
+ (when-let* ((command (or (and (file-remote-p default-directory) cider-gradle-command)
+ (executable-find cider-gradle-command)
+ (executable-find (concat cider-gradle-command ".exe")))))
(shell-quote-argument command)))
@@ -841,7 +841,7 @@ In case `default-directory' is non-local we assume the command is available."
;; file.
(defun cider--check-required-nrepl-version ()
"Check whether we're using a compatible nREPL version."
- (if-let ((nrepl-version (cider--nrepl-version)))
+ (if-let* ((nrepl-version (cider--nrepl-version)))
(when (version< nrepl-version cider-required-nrepl-version)
(cider-repl-manual-warning "troubleshooting/#warning-saying-you-have-to-use-nrepl-0212"
"CIDER requires nREPL %s (or newer) to work properly"
@@ -852,7 +852,7 @@ In case `default-directory' is non-local we assume the command is available."
(defun cider--check-clojure-version-supported ()
"Ensure that we are meeting the minimum supported version of Clojure."
- (if-let ((clojure-version (cider--clojure-version)))
+ (if-let* ((clojure-version (cider--clojure-version)))
(when (version< clojure-version cider-minimum-clojure-version)
(cider-repl-manual-warning "installation/#prerequisites"
"Clojure version (%s) is not supported (minimum %s). CIDER will not work."
diff --git a/doc/indent_spec.md b/doc/indent_spec.md
index 2166a63f..cf101284 100644
--- a/doc/indent_spec.md
+++ b/doc/indent_spec.md
@@ -53,7 +53,7 @@ or `0` for short.
(want))
```
-Sticking to simplicity, the `when-let` macro has one special argument (the
+Sticking to simplicity, the `when-let*` macro has one special argument (the
binding vector) and there's no out-of-the-ordinary internal structure
involved. So the indent spec is just `1` (which is shorthand for `[1]`).
diff --git a/nrepl-client.el b/nrepl-client.el
index 706e4719..78c978a8 100644
--- a/nrepl-client.el
+++ b/nrepl-client.el
@@ -501,7 +501,7 @@ and kill the process buffer."
(message "[nREPL] Connection closed unexpectedly (%s)"
(substring message 0 -1)))
(when (equal (process-status process) 'closed)
- (when-let ((client-buffer (process-buffer process)))
+ (when-let* ((client-buffer (process-buffer process)))
(nrepl--clear-client-sessions client-buffer)
(with-current-buffer client-buffer
(run-hooks 'nrepl-disconnected-hook)
@@ -664,11 +664,11 @@ process."
(process-put client-proc :response-q (nrepl-response-queue))
(with-current-buffer client-buf
- (when-let ((server-buf (and server-proc (process-buffer server-proc))))
+ (when-let* ((server-buf (and server-proc (process-buffer server-proc))))
(setq nrepl-project-dir (buffer-local-value 'nrepl-project-dir server-buf)
nrepl-server-buffer server-buf))
(setq nrepl-endpoint `(,host ,port)
- nrepl-tunnel-buffer (when-let ((tunnel (plist-get endpoint :tunnel)))
+ nrepl-tunnel-buffer (when-let* ((tunnel (plist-get endpoint :tunnel)))
(process-buffer tunnel))
nrepl-pending-requests (make-hash-table :test 'equal)
nrepl-completed-requests (make-hash-table :test 'equal)))
@@ -732,7 +732,7 @@ CONN-BUFFER refers to a (presumably) dead connection, which we can eventually re
It is safe to call this function multiple times on the same ID."
;; FIXME: This should go away eventually when we get rid of
;; pending-request hash table
- (when-let ((handler (gethash id nrepl-pending-requests)))
+ (when-let* ((handler (gethash id nrepl-pending-requests)))
(puthash id handler nrepl-completed-requests)
(remhash id nrepl-pending-requests)))
@@ -841,7 +841,7 @@ connection/session drift.
Return the ID of the sent message.
Optional argument TOOLING Set to t if desiring the tooling session rather than the standard session."
(with-current-buffer connection
- (when-let ((session (if tooling nrepl-tooling-session nrepl-session)))
+ (when-let* ((session (if tooling nrepl-tooling-session nrepl-session)))
(setq request (append request `("session" ,session))))
(let* ((id (nrepl-next-request-id connection))
(request (cons 'dict (lax-plist-put request "id" id)))
@@ -1044,7 +1044,7 @@ client process is started, the function is called with the client buffer."
(set-marker (process-mark process) (point)))
(when moving
(goto-char (process-mark process))
- (when-let ((win (get-buffer-window)))
+ (when-let* ((win (get-buffer-window)))
(set-window-point win (point))))))
;; detect the port the server is listening on from its output
(when (string-match "nREPL server started on port \\([0-9]+\\)" output)
@@ -1159,7 +1159,7 @@ described by `nrepl-message-buffer-name-template'."
(nrepl-log-pp-object (nrepl-decorate-msg msg type)
(nrepl-log--message-color (lax-plist-get (cdr msg) "id"))
t)
- (when-let ((win (get-buffer-window)))
+ (when-let* ((win (get-buffer-window)))
(set-window-point win (point-max)))
(setq buffer-read-only t))))
@@ -1183,7 +1183,7 @@ This in effect enables or disables the logging of nREPL messages."
"Expand the objects hidden in BUTTON's :nrepl-object property.
BUTTON defaults the button at point."
(interactive)
- (if-let ((button (or button (button-at (point)))))
+ (if-let* ((button (or button (button-at (point)))))
(let* ((start (overlay-start button))
(end (overlay-end button))
(obj (overlay-get button :nrepl-object))
@@ -1282,7 +1282,7 @@ it into the buffer."
(let ((min-dict-fold-size 1)
(min-list-fold-size 10)
(min-string-fold-size 60))
- (if-let ((head (car-safe object)))
+ (if-let* ((head (car-safe object)))
;; list-like objects
(cond
;; top level dicts (always expanded)
@@ -1337,7 +1337,7 @@ The default buffer name is *nrepl-error*."
(setq buffer-read-only nil)
(goto-char (point-max))
(insert msg)
- (when-let ((win (get-buffer-window)))
+ (when-let* ((win (get-buffer-window)))
(set-window-point win (point-max)))
(setq buffer-read-only t)))
diff --git a/test/cider-tests--no-auto.el b/test/cider-tests--no-auto.el
index 714e3f10..ad7e95f2 100644
--- a/test/cider-tests--no-auto.el
+++ b/test/cider-tests--no-auto.el
@@ -52,7 +52,7 @@ from the latter. Remaining content is compared for string equality."
(replace-match ""))
(goto-line 2)
(buffer-substring (point) (point-max)))))
- (cider-doc (if-let (doc-buffer (cider-doc-buffer-for sym))
+ (cider-doc (if-let* ((doc-buffer (cider-doc-buffer-for sym))
(with-current-buffer doc-buffer
(let ((inhibit-read-only t))
(goto-char (point-min))