Function: projectile--todos

projectile--todos is a byte-compiled function defined in projectile.el.

Signature

(projectile--todos PROJECTS &optional ARG)

Documentation

Collect the TODO-style annotations of PROJECTS into the search reviewer.

With ARG non-nil, prompt for which keywords to search for. PROJECTS is a list of project roots, so one project and a whole group take the same path; see projectile-search-in-projects for what changes when there is more than one.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile--todos (projects &optional arg)
  "Collect the TODO-style annotations of PROJECTS into the search reviewer.
With ARG non-nil, prompt for which keywords to search for.  PROJECTS is a
list of project roots, so one project and a whole group take the same
path; see `projectile-search-in-projects' for what changes when there is
more than one."
  (let* ((projects (projectile--project-group projects "projects"))
         (keywords (or (if arg
                           (projectile-todos--read-keywords)
                         projectile-todo-keywords)
                       (user-error "`projectile-todo-keywords' is empty")))
         (regexp (projectile-todos--regexp keywords))
         (rg-pattern (projectile-todos--rg-pattern keywords))
         ;; the term IS the regexp, so the in-buffer toggles keep working
         (case-fold nil)
         (candidates (lambda ()
                       (projectile-replace--candidates regexp nil case-fold projects))))
    (projectile-replace--open
     #'projectile-search-mode projectile-search-buffer-name
     (or (projectile--common-parent projects) "/")
     regexp regexp nil nil case-fold candidates
     (projectile-prepend-project-name
      (format "No %s annotations found" (string-join keywords "/")))
     ;; The pattern is already word-fenced and ends in a delimiter, so the
     ;; whole-word fence could never match; whole-word mode is not seeded here.
     nil rg-pattern projects)))