summaryrefslogtreecommitdiff
path: root/lisp/cedet/ede.el
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2015-07-10 04:34:41 +0300
committerDmitry Gutov <dgutov@yandex.ru>2015-07-10 04:40:09 +0300
commitf8c720b55b9419c849ea9febe6f888761a61949b (patch)
tree1b8c1d5e3846eff794d04f69cbb71d54dab82922 /lisp/cedet/ede.el
parent78c3e14aafb6125ea584c78e13df41a35f18c51e (diff)
downloademacs-f8c720b55b9419c849ea9febe6f888761a61949b.tar.gz
Introduce a Project API
* lisp/progmodes/project.el: New file. * lisp/cedet/ede.el: (project-try-ede): New function. (project-root): New implementation. * lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Set project-search-path-function. (elisp--xref-find-references): Delegate some logic to project-search-path. (elisp-search-path): New function. (elisp-xref-find): Don't implement `matches' anymore. * lisp/progmodes/etags.el: Don't implement `matches'. Delegate some logic to project-search-path. (etags-search-path): New function. * lisp/progmodes/xref.el (xref-find-function): Remove `matches' from the API. (xref-find-regexp): Move whatever common logic was in elisp and etags implementations, and search the directories returned by project-directories and project-search-path.
Diffstat (limited to 'lisp/cedet/ede.el')
-rw-r--r--lisp/cedet/ede.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el
index 43660a8bb71..9e92fc7b4af 100644
--- a/lisp/cedet/ede.el
+++ b/lisp/cedet/ede.el
@@ -1517,6 +1517,22 @@ It does not apply the value to buffers."
"Commit change to local variables in PROJ."
nil)
+;;; Integration with project.el
+
+(defun project-try-ede (dir)
+ (let ((project-dir
+ (locate-dominating-file
+ dir
+ (lambda (dir)
+ (ede-directory-get-open-project dir 'ROOT)))))
+ (when project-dir
+ (ede-directory-get-open-project project-dir 'ROOT))))
+
+(cl-defmethod project-root ((project ede-project))
+ (ede-project-root-directory project))
+
+(add-hook 'project-find-functions #'project-try-ede)
+
(provide 'ede)
;; Include this last because it depends on ede.