From e334815395a409779e538e74e7c7d4e8dca8cf69 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 28 Oct 2015 17:29:40 -0400 Subject: [PATCH] Use projectile for narf/project-root --- core/lib/defuns-project.el | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/core/lib/defuns-project.el b/core/lib/defuns-project.el index ac767b088..c0ebc994b 100644 --- a/core/lib/defuns-project.el +++ b/core/lib/defuns-project.el @@ -4,17 +4,24 @@ (defun narf/project-root (&optional strict-p) "Get the path to the root of your project. Uses `narf-project-root-files' to determine if a directory is a project." - (let ((home (file-truename "~"))) - (catch 'found - (f-traverse-upwards - (lambda (path) - (let ((path (file-truename path))) - (if (file-equal-p home path) - (throw 'found (if strict-p nil default-directory)) - (dolist (file narf-project-root-files) - (when (file-exists-p (expand-file-name file path)) - (throw 'found path)))))) default-directory) - default-directory))) + (let (projectile-require-project-root strict-p) (projectile-project-root)) + ;; (let ((home (file-truename "~")) + ;; (path default-directory)) + ;; (unless (file-name-absolute-p path) + ;; (setq path (expand-file-name path))) + ;; (catch 'found + ;; (ignore-errors + ;; (f-traverse-upwards + ;; (lambda (path) + ;; (let ((path (file-truename path))) + ;; (if (file-equal-p home path) + ;; (throw 'found (if strict-p nil default-directory)) + ;; (dolist (file narf-project-root-files) + ;; (when (file-exists-p (expand-file-name file path)) + ;; (throw 'found path)))))) + ;; path)) + ;; default-directory)) + ) ;;;###autoload (defun narf/project-has-files (files &optional root)