From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: tell xref-collect-references to use the right root directory Date: Thu, 21 Jan 2016 13:03:21 -0600 Message-ID: <86io2m69hi.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1453403178 20590 80.91.229.3 (21 Jan 2016 19:06:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jan 2016 19:06:18 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 21 20:06:07 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aMKYX-0007e4-5B for ged-emacs-devel@m.gmane.org; Thu, 21 Jan 2016 20:06:05 +0100 Original-Received: from localhost ([::1]:49355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMKYS-00010O-U1 for ged-emacs-devel@m.gmane.org; Thu, 21 Jan 2016 14:06:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMKYI-0000n9-I9 for emacs-devel@gnu.org; Thu, 21 Jan 2016 14:05:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMKYD-0001dp-IO for emacs-devel@gnu.org; Thu, 21 Jan 2016 14:05:50 -0500 Original-Received: from gproxy6-pub.mail.unifiedlayer.com ([67.222.39.168]:59350) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1aMKYD-0001dO-Ah for emacs-devel@gnu.org; Thu, 21 Jan 2016 14:05:45 -0500 Original-Received: (qmail 5253 invoked by uid 0); 21 Jan 2016 19:05:41 -0000 Original-Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy6.mail.unifiedlayer.com with SMTP; 21 Jan 2016 19:05:41 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmgw4 with id 8j5e1s00Y2UdiVW01j5h13; Thu, 21 Jan 2016 12:05:41 -0700 X-Authority-Analysis: v=2.1 cv=IekUBwaa c=1 sm=1 tr=0 a=CQdxDb2CKd3SRg4I0/XZPQ==:117 a=CQdxDb2CKd3SRg4I0/XZPQ==:17 a=DsvgjBjRAAAA:8 a=f5113yIGAAAA:8 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=9i_RQKNPAAAA:8 a=hEr_IkYJT6EA:10 a=x_XPkuGwIRMA:10 a=7aQ_Q-yQQ-AA:10 a=tYHbb462B4DpQIX7ARgA:9 Original-Received: from [76.218.37.33] (port=54207 helo=TAKVER3) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1aMKY6-00065Y-4J for emacs-devel@gnu.org; Thu, 21 Jan 2016 12:05:38 -0700 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) X-Identified-User: {2442:host114.hostmonster.com:stephele:stephe-leake.org} {sentby:smtp auth 76.218.37.33 authed with stephen_leake@stephe-leake.org} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 67.222.39.168 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:198521 Archived-At: Any objections to this patch? --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -861,7 +861,13 @@ xref-collect-references (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))) -- -- Stephe