bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ctags-devel] [Proposal] Combining of Exuberant Ctags and GNU GLOBAL


From: Shigio YAMAGUCHI
Subject: Re: [Ctags-devel] [Proposal] Combining of Exuberant Ctags and GNU GLOBAL.
Date: Wed, 28 Nov 2012 12:09:55 +0900

Hi all,

Since there was no contrary to my proposal :), I have made a patch
for ctags to integrate GNU GLOBAL.

Please apply attached patch by the following procedure if you like.
I'll make another patch for the latest source code if needed.

$ cd ctags-5.8
$ patch -p1 < ctags-5.8.patch

New option --gtags:
        Print a type string at the head of each tag record of cross reference 
file.
        This option is used to integrate ctags into GNU GLOBAL.

        [Example]
        $ ctags -x --format=1 test.c
        func                5 test.c           func() {

        $ ctags -x --format=1 --gtags test.c
        D func                5 test.c           func() {

        $ ctags -x --format=2 --gtags test.c
        D func             function      5 test.c           func() {

New function makeSimpleReferenceTag():
        Put a type string 'R' at the head of a tag record.
        If you want to treat a tag as a reference, please use this function
        instead of makeSimpleTag(). This function does not influence the output
        of Exuberant Ctags without --gtags option.

        Output of makeSimpleTag()
                D func                5 test.c           func() {

        Output of makeSimpleReferenceTag()
                R func               35 test.c               if (test() == 0) {


If a parser supports reference tags, then you can use global command like 
follows:
(cvs version GLOBAL is needed though)

$ gtags                               # invokes Exuberant Ctags internally
$ global -x func
5            test.c    func() {                         # definition
$ global -xr func
35           test.c           if (func() == 0) {        # reference

The GLOBAL in the CVS repository 
(http://cvs.savannah.gnu.org/viewvc/global/global/)
already includes the code which supports ctags --gtags option. I'm going to 
release it
if there is no contrary. The release will include this (attached) patch too.

Great Ctags!

Best Regards,
Shigio



reply via email to

[Prev in Thread] Current Thread [Next in Thread]