Last active
December 26, 2015 19:48
-
-
Save tonini/7203513 to your computer and use it in GitHub Desktop.
This file contains 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 karma-project-root () | |
(let ((file (file-name-as-directory (expand-file-name default-directory)))) | |
(karma--project-root-identifier file karma--project-root-indicators))) | |
(defun karma--project-root-identifier (file indicators) | |
(let ((root-dir (if indicators (locate-dominating-file file (car indicators)) nil))) | |
(cond (root-dir (directory-file-name (expand-file-name root-dir))) | |
(indicators (karma--project-root-identifier file (cdr indicators))) | |
(t nil)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment