Created
July 19, 2010 08:18
-
-
Save bbatsov/481145 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ffip-project-root () | |
"Return the root of the project. | |
If `locate-dominating-file' is bound we use it directly - otherwise we use | |
a replacement for it. A list of project files is search for - the first | |
match is used to determine the root of the project." | |
(let ((project-files (copy-sequence ffip-project-files)) | |
(project-root nil)) | |
(while (or project-root project-files) | |
(message (car project-files)) | |
(setq project-root (ffip-locate-dominating-file | |
default-directory | |
(car project-files))) | |
(message project-root) | |
(setq project-files (cdr project-files))) | |
(or project-root | |
(progn (message "No project is defined for the current file.") | |
nil))) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment