summaryrefslogtreecommitdiff
path: root/test/lisp/progmodes/project-tests.el
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2022-12-09 18:15:49 +0200
committerDmitry Gutov <dgutov@yandex.ru>2022-12-09 18:19:36 +0200
commitd268ab1c5d749d0f15474f9d200bc0356ad85765 (patch)
treee11c972abc390eb4e78f89b964b46f64e8e8e085 /test/lisp/progmodes/project-tests.el
parentfa36b5ddf58d7b0ef47bd908eb49b3ac8964311d (diff)
downloademacs-d268ab1c5d749d0f15474f9d200bc0356ad85765.tar.gz
Bring back the project--value-in-dir logic
Essentialy revert commit 2389158a31b4a12, restoring the changes and fixing the conflicts. Motivated by the problem brought up in bug#59722 (behavior of project-find-files/regexp when switching projects). We should find other ways to improve performance. * lisp/progmodes/project.el (project--value-in-dir, project--vc-merge-submodules-p): Restore. (project-try-vc, project-files, project--vc-list-files) (project-ignores, project-buffers): Use. * test/lisp/progmodes/project-tests.el (project-vc-supports-project-in-different-dir): New test. * test/lisp/progmodes/project-resources/.dir-locals.el: * test/lisp/progmodes/project-resources/foo: * test/lisp/progmodes/project-resources/etc: New files.
Diffstat (limited to 'test/lisp/progmodes/project-tests.el')
-rw-r--r--test/lisp/progmodes/project-tests.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/lisp/progmodes/project-tests.el b/test/lisp/progmodes/project-tests.el
index c3b886873d3..e666e3a6fab 100644
--- a/test/lisp/progmodes/project-tests.el
+++ b/test/lisp/progmodes/project-tests.el
@@ -139,4 +139,17 @@ When `project-ignores' includes a name matching project dir."
(should-not (null project))
(should (string-match-p "/test/lisp/\\'" (project-root project)))))
+(ert-deftest project-vc-supports-project-in-different-dir ()
+ "Check that it picks up dir-locals settings from somewhere else."
+ (skip-unless (eq (vc-responsible-backend default-directory) 'Git))
+ (let* ((dir (ert-resource-directory))
+ (_ (vc-file-clearprops dir))
+ (project-vc-extra-root-markers '(".dir-locals.el"))
+ (project (project-current nil dir)))
+ (should-not (null project))
+ (should (string-match-p "/test/lisp/progmodes/project-resources/\\'" (project-root project)))
+ (should (member "etc" (project-ignores project dir)))
+ (should (equal '(".dir-locals.el" "foo")
+ (mapcar #'file-name-nondirectory (project-files project))))))
+
;;; project-tests.el ends here