mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Improve narf/project-has-files
This commit is contained in:
@ -25,13 +25,12 @@ determine if a directory is a project."
|
|||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun narf/project-has-files (files &optional root)
|
(defun narf/project-has-files (files &optional root)
|
||||||
"Return non-nil if `file' exists in the project root."
|
"Return non-nil if FILES exist in the project root."
|
||||||
(let ((root (or root (narf/project-root)))
|
(let ((root (or root (narf/project-root)))
|
||||||
(files (if (listp files) files (list files)))
|
(files (if (listp files) files (list files)))
|
||||||
found-p file)
|
(found-p (if files t)))
|
||||||
(while (and files (not found-p))
|
(while found-p
|
||||||
(setq file (pop files))
|
(setq found-p (file-exists-p (narf/project-path-to (pop files) root))))
|
||||||
(setq found-p (file-exists-p (narf/project-path-to file root))))
|
|
||||||
found-p))
|
found-p))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
Reference in New Issue
Block a user