Browse files

Allow ffip-project-root to be a list.

  • Loading branch information...
1 parent 4a133b5 commit 16f42fde17696b1b4fc36d7151500b115b2a9986 @technomancy committed Jul 15, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 find-file-in-project.el
@@ -63,7 +63,7 @@
(defvar ffip-project-file ".git"
"The file that should be used to define a project root.
-May be set using .dir-locals.el.")
+May be set using .dir-locals.el. Checks each entry if set to a list.")
(defvar ffip-patterns
'("*.html" "*.org" "*.txt" "*.md" "*.el" "*.clj" "*.py" "*.rb" "*.js" "*.pl"
@@ -94,8 +94,12 @@ This overrides variable `ffip-project-root' when set.")
(let ((project-root (or ffip-project-root
(if (functionp ffip-project-root-function)
(funcall ffip-project-root-function)
- (locate-dominating-file default-directory
- ffip-project-file)))))
+ (if (listp ffip-project-file)
+ (some (apply-partially 'locate-dominating-file
+ default-directory)
+ ffip-project-file)
+ (locate-dominating-file default-directory
+ ffip-project-file))))))
(or project-root
(progn (message "No project was defined for the current file.")

0 comments on commit 16f42fd

Please sign in to comment.