Function: projectile-remove-ignored
projectile-remove-ignored is a byte-compiled function defined in
projectile.el.
Signature
(projectile-remove-ignored FILES &optional ROOT)
Documentation
Remove ignored files and folders from FILES.
FILES are paths relative to the project root. They are matched against
the project's ignore patterns (see projectile--ignore-patterns), the
same gitignore-style rules the native indexer and the alien push-down
apply; ! ensure patterns rescue files from them.
ROOT names the project whose rules apply, defaulting to the current one. Pass it whenever the files being filtered belong to a project other than the one you are visiting - listing another project's files otherwise filters them by the rules of the project you happen to be in, and with caching on stores that wrong answer under the other project's key.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-remove-ignored (files &optional root)
"Remove ignored files and folders from FILES.
FILES are paths relative to the project root. They are matched against
the project's ignore patterns (see `projectile--ignore-patterns'), the
same gitignore-style rules the native indexer and the alien push-down
apply; `!' ensure patterns rescue files from them.
ROOT names the project whose rules apply, defaulting to the current one.
Pass it whenever the files being filtered belong to a project other than
the one you are visiting - listing another project's files otherwise
filters them by the rules of the project you happen to be in, and with
caching on stores that wrong answer under the other project's key."
(let* (;; Ignore matching is case-sensitive; `string-match-p' would
;; otherwise fold case, since `case-fold-search' defaults to t.
(case-fold-search nil)
(filtering-patterns (projectile-filtering-patterns root))
(ignore-re (projectile--compile-ignore-patterns
(car filtering-patterns)))
(ensure-re (projectile--compile-ignore-patterns
(cdr filtering-patterns))))
(if (null ignore-re)
files
(seq-remove
(lambda (file)
(and (string-match-p ignore-re file)
(not (and ensure-re (string-match-p ensure-re file)))))
files))))