From 44c7b49d9a8188e8befc85f7e95d074ad4605c6a Mon Sep 17 00:00:00 2001 From: Stephen Leake Date: Fri, 22 Jan 2016 01:53:05 -0600 Subject: [PATCH] In xref-collect-references, force backends to respect the 'dir' arg * lisp/progmodes/xref.el (xref-collect-references): Force symref backends to use `default-directory'. --- lisp/progmodes/xref.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 2bccd857576..d32da371771 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -861,7 +861,13 @@ tools are used, and when." (cl-assert (directory-name-p dir)) (require 'semantic/symref) (defvar semantic-symref-tool) - (let* ((default-directory dir) + + ;; Some symref backends use `ede-project-root-directory' as the root + ;; directory for the search, rather than `default-directory'. Since + ;; the caller has specified `dir', we bind `ede-minor-mode' to nil + ;; to force the backend to use `default-directory'. + (let* ((ede-minor-mode nil) + (default-directory dir) (semantic-symref-tool 'detect) (res (semantic-symref-find-references-by-name symbol 'subdirs)) (hits (and res (oref res hit-lines))) -- 2.39.2