Function: projectile-search-in-projects
projectile-search-in-projects is an autoloaded and byte-compiled
function defined in projectile.el.
Signature
(projectile-search-in-projects PROJECTS &optional LITERAL PROMPT)
Documentation
Search PROJECTS for a term and review the matches read-only.
LITERAL non-nil searches for a literal string, otherwise the term is an Emacs regexp. PROMPT overrides the label the term is read with.
This is projectile-search-review widened to a group, and that command
is the single-project case of it: matches from every project land in one
*projectile-search* buffer, grouped by file and named relative to the
innermost directory containing the group, so each one is labelled with
the project it came from. Everything that buffer does - filtering,
re-search, the hand-off to the replace reviewer - then covers the whole
group.
Each member of the group is filtered by its own ignore rules, wherever
you happen to be sitting, and a literal search runs rg over each of
them in turn when ripgrep is available.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
;;;###autoload
(defun projectile-search-in-projects (projects &optional literal prompt)
"Search PROJECTS for a term and review the matches read-only.
LITERAL non-nil searches for a literal string, otherwise the term is an
Emacs regexp. PROMPT overrides the label the term is read with.
This is `projectile-search-review' widened to a group, and that command
is the single-project case of it: matches from every project land in one
`*projectile-search*' buffer, grouped by file and named relative to the
innermost directory containing the group, so each one is labelled with
the project it came from. Everything that buffer does - filtering,
re-search, the hand-off to the replace reviewer - then covers the whole
group.
Each member of the group is filtered by its own ignore rules, wherever
you happen to be sitting, and a literal search runs `rg' over each of
them in turn when ripgrep is available."
(let* ((projects (projectile--project-group projects "projects"))
(term (projectile--read-search-string-with-default
(or prompt (format "Search %d project%s%s for"
(length projects)
(if (cdr projects) "s" "")
(if literal "" " regexp")))))
(regexp (if literal (regexp-quote term) term))
(case-fold case-fold-search)
(candidates (lambda ()
(projectile-replace--candidates
term literal case-fold projects))))
(projectile-replace--open
#'projectile-search-mode projectile-search-buffer-name
(or (projectile--common-parent projects) "/")
term regexp nil literal case-fold candidates
(projectile-prepend-project-name (format "No matches for %s" term))
projectile-search-whole-word nil projects)))