help-global
[Top][All Lists]
Advanced

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

Re: What exactly does --from-here do?


From: Shigio YAMAGUCHI
Subject: Re: What exactly does --from-here do?
Date: Fri, 1 Feb 2013 21:24:35 +0900

Hi,
On Fri, 01 Feb 2013 18:41:24 +0800
Leo Liu <address@hidden> wrote:

> Hi,
> 
> I am trying to make sense of --from-here to global without success.
> Ideas? Thanks.
> 
> Leo

Please try the followings.

$ emacs -f gtags-mode xxx.c     # load c source file with gtags-mode

(put the cursor on the symbol which is a definition)

M-x gtags-find-from-here [Enter]        -> Jump to the references (global -rx 
<symbol>)

(put the cursor on the symbol which is a reference)

M-x gtags-find-from-here [Enter]        -> Jump to the definitions (global -dx 
<symbol>)

(put the cursor on the symbol which is an other symbol)

M-x gtags-find-from-here [Enter]        -> Jump to the same symbols (global -sx 
<symbol>)

The gtags-find-from-here command calls global with the --from-here option 
internally.
You might feel emacs like a browser.

An example is shown below.

[test.c]
99:     }
100:    func() {                        <= definition           ... (A)
101:            int a;                  <= other symbol         ... (B)
102:    }
103:
104:            if (func()) {           <= reference            ... (C)
105:

        Command line using the --from-here      is executed as
---------------------------------------------------------------
(A)     global --from-here=100:test.c func      global -rx func
(B)     global --from-here=101:test.c a         global -sx a
(C)     global --from-here=104:test.c func      global -dx func

Please see gtags.el, gtags.vim, elvis.rc, gtags.p in the GLOBAL package for the 
detail.

Shigio
-- 
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3



reply via email to

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