aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/project.el10
-rw-r--r--lisp/progmodes/xref.el6
2 files changed, 12 insertions, 4 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index eaa2f9aa405..26b32b4b750 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -42,7 +42,7 @@ that it is not applicable, or a project instance.")
42The directories in which we can look for the declarations or 42The directories in which we can look for the declarations or
43other references to the symbols used in the current buffer. 43other references to the symbols used in the current buffer.
44Depending on the language, it should include the headers search 44Depending on the language, it should include the headers search
45path, load path, class path, or so on. 45path, load path, class path, and so on.
46 46
47The directory names should be absolute. Normally set by the 47The directory names should be absolute. Normally set by the
48major mode. Used in the default implementation of 48major mode. Used in the default implementation of
@@ -61,8 +61,8 @@ The directory name should be absolute.")
61(cl-defgeneric project-search-path (project) 61(cl-defgeneric project-search-path (project)
62 "Return the list of source directories. 62 "Return the list of source directories.
63Including any where source (or header, etc) files used by the 63Including any where source (or header, etc) files used by the
64current project may be found. Including those outside of the 64current project may be found, inside or outside of the project
65project tree. The directory names should be absolute. 65tree. The directory names should be absolute.
66 66
67A specialized implementation should use the value 67A specialized implementation should use the value
68`project-search-path-function', or, better yet, call and combine 68`project-search-path-function', or, better yet, call and combine
@@ -71,6 +71,10 @@ major modes used in the project. Alternatively, it can return a
71user-configurable value." 71user-configurable value."
72 (project--prune-directories 72 (project--prune-directories
73 (nconc (funcall project-search-path-function) 73 (nconc (funcall project-search-path-function)
74 ;; Include these, because we don't know any better.
75 ;; But a specialized implementation may include only some of
76 ;; the project's subdirectories, if there are no source
77 ;; files at the top level.
74 (project-directories project)))) 78 (project-directories project))))
75 79
76(cl-defgeneric project-directories (project) 80(cl-defgeneric project-directories (project)
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index f2f02a41367..2ac76e8a263 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -666,7 +666,11 @@ to search in."
666 (interactive (list (xref--read-identifier "Find regexp: "))) 666 (interactive (list (xref--read-identifier "Find regexp: ")))
667 (let* ((dirs (if current-prefix-arg 667 (let* ((dirs (if current-prefix-arg
668 (list (read-directory-name "In directory: ")) 668 (list (read-directory-name "In directory: "))
669 (project-search-path (project-current)))) 669 (let ((proj (project-current)))
670 (project--prune-directories
671 (nconc
672 (project-directories proj)
673 (project-search-path proj))))))
670 (xref-find-function 674 (xref-find-function
671 (lambda (_kind regexp) 675 (lambda (_kind regexp)
672 (cl-mapcan 676 (cl-mapcan