Function: projectile-root-top-down

projectile-root-top-down is a byte-compiled function defined in projectile.el.

Signature

(projectile-root-top-down DIR &optional LIST)

Documentation

Identify a project root in DIR by top-down search for files in LIST.

If LIST is nil, use projectile-project-root-files instead. Return the first (topmost) matched directory or nil if not found.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260310.858/projectile.el
(defun projectile-root-top-down (dir &optional list)
  "Identify a project root in DIR by top-down search for files in LIST.
If LIST is nil, use `projectile-project-root-files' instead.
Return the first (topmost) matched directory or nil if not found."
  (projectile-locate-dominating-file-top-down
   dir
   (lambda (dir)
     (seq-find (lambda (f)
                    (let ((expanded (projectile-expand-file-name-wildcard f dir)))
                      (and (projectile-file-exists-p expanded)
                           (not (file-directory-p expanded)))))
                 (or list projectile-project-root-files)))))