[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/projectile f9b0fd0ec7 1/2: Add a projectile-root-marked fu
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/projectile f9b0fd0ec7 1/2: Add a projectile-root-marked function for finding roots |
Date: |
Sat, 12 Nov 2022 04:59:09 -0500 (EST) |
branch: elpa/projectile
commit f9b0fd0ec7467e3196c2513c29de1019d7bc2c3d
Author: Greg Pfeil <greg@technomadic.org>
Commit: Bozhidar Batsov <bozhidar@batsov.dev>
Add a projectile-root-marked function for finding roots
Prioritizes .projectile above other bottom-up root files.
Related to #1810.
---
projectile.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/projectile.el b/projectile.el
index 7792e7a4c7..b409ebded7 100644
--- a/projectile.el
+++ b/projectile.el
@@ -321,8 +321,7 @@ See `projectile-register-project-type'."
:type '(repeat string))
(defcustom projectile-project-root-files-bottom-up
- '(".projectile" ; projectile project marker
- ".git" ; Git VCS root dir
+ '(".git" ; Git VCS root dir
".hg" ; Mercurial VCS root dir
".fslckout" ; Fossil VCS root dir
"_FOSSIL_" ; Fossil VCS root DB on Windows
@@ -351,6 +350,7 @@ containing a root file."
(defcustom projectile-project-root-functions
'(projectile-root-local
+ projectile-root-marked
projectile-root-bottom-up
projectile-root-top-down
projectile-root-top-down-recurring)
@@ -1199,6 +1199,10 @@ Return the first (topmost) matched directory or nil if
not found."
(cl-find-if (lambda (f) (projectile-file-exists-p (expand-file-name f
dir)))
(or list projectile-project-root-files)))))
+(defun projectile-root-marked (dir)
+ "Identify a project root in DIR by search for a .projectile file."
+ (projectile-root-bottom-up dir '(".projectile")))
+
(defun projectile-root-bottom-up (dir &optional list)
"Identify a project root in DIR by bottom-up search for files in LIST.
If LIST is nil, use `projectile-project-root-files-bottom-up' instead.