I tried to understand how to use cscope (with the Vim source as a set of 
sources to apply it to). Bram, correct me if I'm wrong.

The following assumes $VIMSRC has been set (e.g. in the vimrc) to the 
top-level directory of the Vim source & runtime distribution (on my 
system, currently ~/.build/vim/vim72 )

- First of all, build the database (done once).

        :new
        :lcd $VIMSRC/src
        :!cscope -bv ./*.[ch] ./perl.xs auto/*.h auto/pathdef.c

I have searched the src/Makefile for a target doing this kind of stuff 
(the way the tags target builds a Vim tagfile for the same source) but 
have failed.

It's not clear to me whether to repeat this after the sources change, 
I'll have to read the cscope manpage in more detail (it seems to say 
cscope is clever enough to update the database if the sources have 
changed, but can I rely on that?)

BTW, here "cscope --version" anwsers:
cscope: version 15.6

- Once per session (done manually when starting to use it). First two 
lines are of course not needed if already done by building the database 
as shown above. Last line (setting 'cscopequickfix') can be in vimrc. It 
is of course the "useful setting" given at ":help csqf" with no quotes 
(also no single quotes around 'csqf').

        :new
        :lcd $VIMSRC/src
        :cs add cscope.out
        " use quickfix for most common queries
        :set csqf=s-,c-,d-,i-,t-,e-

- Find where a symbol is defined (with an example from a recent vim_dev 
thread)

        :cs find g TBUFSZ

- Find where symbol is used (using the same symbol)

        :cs find s TBUFSZ

etc.


Best regards,
Tony.
-- 
Jacquin's Postulate on Democratic Government:
        No man's life, liberty, or property are safe while the
legislature is in session.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui