File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -979,17 +979,22 @@ nil."
979
979
980
980
981
981
982
- (defun clojure-project-dir ()
982
+ (defun clojure-project-dir (dir-name )
983
983
" Return the absolute path to the project's root directory."
984
- (file-truename
985
- (or (locate-dominating-file default-directory
986
- " project.clj" )
987
- (locate-dominating-file default-directory
988
- " build.boot" ))))
984
+ (when dir-name
985
+ (let ((lein-project-dir (locate-dominating-file dir-name " project.clj" ))
986
+ (boot-project-dir (locate-dominating-file dir-name " build.boot" )))
987
+ (file-truename
988
+ (reduce #' (lambda (x y )
989
+ (cond ((not x) y)
990
+ ((not y) x)
991
+ (t (if (file-in-directory-p x y) x y))))
992
+ (list lein-project-dir
993
+ boot-project-dir))))))
989
994
990
995
(defun clojure-project-relative-path (path )
991
996
" Denormalize PATH by making it relative to the project root."
992
- (file-relative-name path (clojure-project-dir)))
997
+ (file-relative-name path (clojure-project-dir default-directory )))
993
998
994
999
(defun clojure-expected-ns (&optional path )
995
1000
" Return the namespace matching PATH.
You can’t perform that action at this time.
0 commit comments