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: Re: xref and GNU Global (Re: ELPA policy) Date: Thu, 12 Nov 2015 01:05:58 -0600 Message-ID: <86k2pnelyh.fsf@stephe-leake.org> References: <87ziyuaqhl.fsf@petton.fr> <22074.42230.156669.584780@retriever.mtv.corp.google.com> <87ziyoxvdp.fsf@Rainer.invalid> <83k2psnzyh.fsf@gnu.org> <87mvuorz7n.fsf@gmail.com> <8337wfon3f.fsf@gnu.org> <56401834.8080402@yandex.ru> <83ziynma4s.fsf@gnu.org> <5640C6A0.5010709@yandex.ru> <83twovm9es.fsf@gnu.org> <868u65afvh.fsf@stephe-leake.org> <5642383F.2040907@yandex.ru> <87h9ktsnhl.fsf@isaac.fritz.box> <56424CD9.8000008@yandex.ru> <87pozgbm96.fsf@petton.fr> <86k2pob06d.fsf@stephe-leake.org> <87twosccvp.fsf@petton.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1447312012 5971 80.91.229.3 (12 Nov 2015 07:06:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Nov 2015 07:06:52 +0000 (UTC) Cc: David Engster , aaronecay@gmail.com, emacs-devel@gnu.org, Stromeko@nexgo.de, Dmitry Gutov , Eli Zaretskii To: Nicolas Petton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 12 08:06:40 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 1Zwlxw-0005Lf-JE for ged-emacs-devel@m.gmane.org; Thu, 12 Nov 2015 08:06:40 +0100 Original-Received: from localhost ([::1]:44881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwlxw-0004fc-27 for ged-emacs-devel@m.gmane.org; Thu, 12 Nov 2015 02:06:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwlxe-0004fK-8k for emacs-devel@gnu.org; Thu, 12 Nov 2015 02:06:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwlxa-0001ip-7P for emacs-devel@gnu.org; Thu, 12 Nov 2015 02:06:22 -0500 Original-Received: from gproxy7-pub.mail.unifiedlayer.com ([70.40.196.235]:44355) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Zwlxa-0001iI-0V for emacs-devel@gnu.org; Thu, 12 Nov 2015 02:06:18 -0500 Original-Received: (qmail 18066 invoked by uid 0); 12 Nov 2015 07:06:12 -0000 Original-Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy7.mail.unifiedlayer.com with SMTP; 12 Nov 2015 07:06:12 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmgw4 with id gX611r00z2UdiVW01X64rj; Thu, 12 Nov 2015 00:06:12 -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=9i_RQKNPAAAA:8 a=hEr_IkYJT6EA:10 a=x_XPkuGwIRMA:10 a=qtqOOiqGOCEA:10 a=ws68gFRJJT08ZYiYrhwA:9 Original-Received: from [76.218.37.33] (port=49948 helo=TAKVER2) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1ZwlxJ-0003qF-NP; Thu, 12 Nov 2015 00:06:01 -0700 In-Reply-To: <87twosccvp.fsf@petton.fr> (Nicolas Petton's message of "Thu, 12 Nov 2015 00:52:42 +0100") 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: 70.40.196.235 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:194195 Archived-At: Nicolas Petton writes: > Stephen Leake writes: > >>> What about having support for Global (I haven't followed the development >>> of xref in a while, so I might have missed it). I'm using ggtags now, >>> but having support for it in xref would be awesome. >> >> I'm working on it, but I seem to be going very slowly. > > Do you want help? Yes, but the main reason I'm not making progress on this backend is that I keep getting distracted by other project.el and xref issues. Here's what I have so far - feel free to play with it: --- file symref-patches.el ;; Additions to semantic/symref.el ;; semantic/symref implementation of xref-find-function (defun semantic-symref--xref-find-definitions (symbol &optional symref-tool) "Implement `xref-find-function' for 'definitions for the semantic/symref backend. SYMREF-TOOL determines which symref tool to use (default 'detect); see `semantic-symref-tool-alist'." (require 'semantic/symref) (defvar semantic-symref-tool) (let* ((semantic-symref-tool (or symref-tool 'detect)) (res (semantic-symref-find-tags-by-name symbol 'project)) (hits (and res (oref res hit-lines))) xrefs) (dolist (hit hits) (push (xref-file-location :file (cdr hit) :line (car hit) :column 0) ;; FIXME: add :hint (match-string 3)) xrefs)) xrefs)) (defun semantic-symref-xref-find (action id) "Implement `xref-find-function' for semantic/symref." (cl-ecase action (definitions (semantic-symref--xref-find-definitions id)) (references (semantic-symref--xref-find-references id)) (apropos (semantic-symref--xref-find-apropos id))) ) (provide 'symref-patches) --- end file > BTW, regarding CEDET, I never tried it, but I don't plan to use it > either. I think the best would be to just add a simple backend for > xref, with no dependency to CEDET. The above requires that you enable EDE via: (require 'ede) (global-ede-mode) (ede-enable-generic-projects) but it does not require semantic-mode. EDE is required because the symref backend detection uses EDE to find the project root. For Gnu Global, that could be changed to one call to locate-dominating-file. But I'm waiting for the current CEDET merge to master to be complete before suggesting changes to this. This gets to the issue of whether CEDET is part of the Emacs standard library or not. If it is, we should use it, while also making it more transparent to users like you, who would rather not be bothered by it. Which is an example of the kind of thing I get distracted by :). Can you elaborate on why you don't want to use CEDET? I'm assuming you mean you don't want to enable semantic-mode or ede-mode; you should not care whether the file cedet-global.el is loaded. -- -- Stephe