From 6fd3f3965e505cb0f682402852de47b047aa52fd Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 13 Feb 2016 01:12:25 -0500 Subject: [PATCH] Improve narf/project-has-files --- core/defuns/defuns-project.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/defuns/defuns-project.el b/core/defuns/defuns-project.el index c0ebc994b..82af38c24 100644 --- a/core/defuns/defuns-project.el +++ b/core/defuns/defuns-project.el @@ -25,13 +25,12 @@ determine if a directory is a project." ;;;###autoload (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))) (files (if (listp files) files (list files))) - found-p file) - (while (and files (not found-p)) - (setq file (pop files)) - (setq found-p (file-exists-p (narf/project-path-to file root)))) + (found-p (if files t))) + (while found-p + (setq found-p (file-exists-p (narf/project-path-to (pop files) root)))) found-p)) ;;;###autoload