From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Allow xref to use other than current major-mode Date: Tue, 25 Aug 2015 14:48:34 +0300 Message-ID: <55DC5612.9050704@yandex.ru> References: <86fv37it65.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1440503341 19449 80.91.229.3 (25 Aug 2015 11:49:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Aug 2015 11:49:01 +0000 (UTC) To: Stephen Leake , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 25 13:48:56 2015 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 1ZUCij-00078x-1p for ged-emacs-devel@m.gmane.org; Tue, 25 Aug 2015 13:48:53 +0200 Original-Received: from localhost ([::1]:59387 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUCih-0003xT-Rm for ged-emacs-devel@m.gmane.org; Tue, 25 Aug 2015 07:48:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUCif-0003xO-5q for emacs-devel@gnu.org; Tue, 25 Aug 2015 07:48:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUCib-0005Xi-TW for emacs-devel@gnu.org; Tue, 25 Aug 2015 07:48:49 -0400 Original-Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:37655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUCib-0005Xc-MX for emacs-devel@gnu.org; Tue, 25 Aug 2015 07:48:45 -0400 Original-Received: by widdq5 with SMTP id dq5so12465627wid.0 for ; Tue, 25 Aug 2015 04:48:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=OdgAxcXgOuFyMfQx3eQZKD2+u1E9lp+5XnHS1JToDGw=; b=u1TCttujk9XyjDhOz3Ao0Zf3FV8iDQOlSGmt14ogxJgBtTyOW/UL2CnN5iwu7LGRma 1Aw+4OvrNjJgI64lQ8VQsBdEmFwjU7BJlWXuVTkIgcqdvN2CdX8WM+SkI13xkpDmnHbo FmtOA8OSroKBE/87IKPS4TFQr6QR4PQHaWNKVY35FAstmEjolljmlKxtP/LqnXCtlHAF dct+q0K6SX1QIfIMH3yA4DYW72LD7rTzZuIrFlJY5qof6Z/w4QU5DXR9X2EdAjUzoulB qB2vn8fTGE6419oVrw9QkK3WjJunWP8TSixNX6kGpLgyqm+iCJQFBreOG3ecl+LOd3WF rOWA== X-Received: by 10.180.208.34 with SMTP id mb2mr4171588wic.88.1440503325089; Tue, 25 Aug 2015 04:48:45 -0700 (PDT) Original-Received: from [10.9.0.103] (nat.webazilla.com. [78.140.128.228]) by smtp.googlemail.com with ESMTPSA id h9sm27739717wjx.20.2015.08.25.04.48.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Aug 2015 04:48:44 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Thunderbird/40.0 In-Reply-To: <86fv37it65.fsf@stephe-leake.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::236 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:189151 Archived-At: On 08/25/2015 01:00 PM, Stephen Leake wrote: > To handle this, I propose changing both > xref-identifier-completion-table-function and xref-find-function to be > mode-local, instead of buffer-local. That seems unnecessarily limiting. First, mode-local facility is a part of CEDET, so it would need to be always loaded. Second, how would a minor mode set an xref backend? It might not be tied to a particular major mode. > There are similar use cases; from a LaTeX document buffer, looking at the > description of an Ada function, find the Ada code that defines that > function. Or from a text mode notes file, look for a definition in any > one of several languages. All similar cases can be solved by a project-aware xref backend that knows about all languages used, and allows navigating to identifiers in all of them.