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? Date: Fri, 21 Aug 2015 07:37:18 -0500 Message-ID: <86pp2gstq9.fsf@stephe-leake.org> References: <87d1yjfy6d.fsf@petton.fr> <87y4h7klht.fsf@petton.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1440160693 5822 80.91.229.3 (21 Aug 2015 12:38:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Aug 2015 12:38:13 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 21 14:38:02 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 1ZSla5-00007C-TL for ged-emacs-devel@m.gmane.org; Fri, 21 Aug 2015 14:38:02 +0200 Original-Received: from localhost ([::1]:41323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSla5-0007jo-9V for ged-emacs-devel@m.gmane.org; Fri, 21 Aug 2015 08:38:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSla2-0007jZ-4N for emacs-devel@gnu.org; Fri, 21 Aug 2015 08:37:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZSlZy-0007wC-U4 for emacs-devel@gnu.org; Fri, 21 Aug 2015 08:37:58 -0400 Original-Received: from gproxy9-pub.mail.unifiedlayer.com ([69.89.20.122]:40429) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ZSlZy-0007vG-NR for emacs-devel@gnu.org; Fri, 21 Aug 2015 08:37:54 -0400 Original-Received: (qmail 24973 invoked by uid 0); 21 Aug 2015 12:37:48 -0000 Original-Received: from unknown (HELO CMOut01) (10.0.90.82) by gproxy9.mail.unifiedlayer.com with SMTP; 21 Aug 2015 12:37:48 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by CMOut01 with id 7Qde1r00L2UdiVW01QdhDZ; Fri, 21 Aug 2015 06:37:47 -0600 X-Authority-Analysis: v=2.1 cv=EbVbHpWC 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=y7kgw_RnJtkA:10 a=hEr_IkYJT6EA:10 a=x_XPkuGwIRMA:10 a=uRRa74qj2VoA:10 a=5HbYRRQ1SBCMWNprl7UA:9 Original-Received: from [76.218.37.33] (port=49661 helo=TAKVER2) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1ZSlZi-0002yk-Go for emacs-devel@gnu.org; Fri, 21 Aug 2015 06:37:38 -0600 In-Reply-To: <87y4h7klht.fsf@petton.fr> (Nicolas Petton's message of "Wed, 19 Aug 2015 23:37:50 +0200") 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: 69.89.20.122 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:189034 Archived-At: Nicolas Petton writes: > Stefan Monnier writes: > >>> I find GNU Global to be far superior to etags or ctags. Is there any >>> plan to have support for it in xref.el? (Or maybe there is and I missed >>> it). >> >> Yes. IIRC the plan is to wait for Nicolas Petton to start working on >> it. > > Hmm, right. First I'll have a look at what semantic & xref already have > to offer :) One approach is to use what semantic currently has for gnu global; that's in emacs/lisp/cedet/semantic/db-global.el. I'm not clear if all of that is accessible via the xref interface yet. I suspect semantic/db-global.el provides the same functionality as ggtags, possibly without as much UI; the current design goal is for xref to be the UI for semantic cross-reference features. Another approach is to try to integrate ggtags with xref. There are two major differences between ggtags and xref: xref provides a way to dispatch, in order to choose the right tool. ggtags apparently has another way. In addition, ggtags uses compilation mode to display the results; xref has a different display by default (the display function can be changed by a hook). The first step is to decouple the gnu global code into "UI", "accumulate reference" and "display references" sections (that may be done already; I didn't actually look). Then set xref-find-function and a few other things, to have the xref UI dispatch to the Gnu Global "accumulate references" code. Then you can either add new code that produces xref-locations, or set the hook that changes the display function for xref. -- -- Stephe