Skip to content

Instantly share code, notes, and snippets.

@tonini
Last active December 26, 2015 19:48
Show Gist options
  • Save tonini/7203513 to your computer and use it in GitHub Desktop.
Save tonini/7203513 to your computer and use it in GitHub Desktop.
(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