Function: embark-consult--async-search-dwim
embark-consult--async-search-dwim is a natively compiled function
defined in embark-consult.el.
Signature
(embark-consult--async-search-dwim &key ACTION TYPE TARGET CANDIDATES &allow-other-keys)
Documentation
DWIM when using a Consult async search command as an ACTION.
If the TYPE of the target(s) has a notion of associated
file (files, buffers, libraries and some bookmarks do), then run
the ACTION with consult-project-function set to nil, and search
only the files associated to the TARGET or CANDIDATES. For other
types, run the ACTION with TARGET or CANDIDATES as initial input.
Source Code
;; Defined in /nix/store/9j1lpwknj0cd46jf87pww3rp6rcmnk70-emacs-packages-deps/share/emacs/site-lisp/elpa/embark-consult-20260503.118/embark-consult.el
(cl-defun embark-consult--async-search-dwim
(&key action type target candidates &allow-other-keys)
"DWIM when using a Consult async search command as an ACTION.
If the TYPE of the target(s) has a notion of associated
file (files, buffers, libraries and some bookmarks do), then run
the ACTION with `consult-project-function' set to nil, and search
only the files associated to the TARGET or CANDIDATES. For other
types, run the ACTION with TARGET or CANDIDATES as initial input."
(if-let* ((file-fn (cdr (assq type embark--associated-file-fn-alist))))
(let (consult-project-function)
(funcall action
(delq nil (mapcar file-fn (or candidates (list target))))))
(funcall action nil (or target (string-join candidates " ")))))