idutils and Python

Ramon Diaz-Uriarte rdiaz02 at gmail.com
Tue Aug 22 06:05:20 EDT 2006


On 21 Aug 2006 22:56:13 -0700, sjdevnull at yahoo.com <sjdevnull at yahoo.com> wrote:

> What exactly are you trying to accomplish?  If you want to index
> function/class names, variables, etc then you should take a look at
> "exuberant ctags" http://ctags.sourceforge.net53 --although it started
> off as a C indexer, it has excellent Python support, it's free, and as
> a bonus its indices are well supported from inside major editors (vim,
> emacs, etc) so you can easily follow code flow, find function/class
> definitions, etc.


Sorry for not being clear enough. I want the following:

a) have my editor go to the point where a function/whatever is defined

b) see all places where a function/whatever is used.

I've tried exuberant ctags and I do like it a lot. a) is done
wonderfully (within emacs, the editor I use, but also in other
editros, from what I've read).  However, b) does not work exactly as
I'd like:

1.  With Emacs and tags: using "tags-search" I can visit, one by one,
all places where a function is called, but I'd like to see where it is
called before visting that file and know, before visiting each file in
turn, whether I'll visit 1 or 20 files (or, to put it in another way,
I'd like to see like a poor-mans static callgraph).

2. From what I understand, there is a deeper difference than just how
results are shown: the tags file contains the places where, say, a
function is defined, but finding where it is used requires running
grep on every file looking for the tag. (I believe that is what
"tags-search" does in emacs).  In contrast, ID utils does not do any
grep, but directly goes to the ID file, where all that is already
pre-stored, which also means that it will be a lot faster than
grepping for the tags.

A tool similar to IDutils is Global
http://www.gnu.no/software/global/, but it also does not incorporate
Python support. (Though defining other parsers might be simple; I
haven't looked at it closely).

I think the wish "do not use grep, just look at the index file, and
immediately display all matches"  is reasonable and probably other
Python coders had thought about it before. But I am wondering if I am
missing something obvious, as most people seem to be very happy with
exuberant ctags.


Thanks,

R.

On 21 Aug 2006 22:56:13 -0700, sjdevnull at yahoo.com <sjdevnull at yahoo.com> wrote:
> Ramon Diaz-Uriarte wrote:
> > Dear All,
> >
> > Has anybody tried to use ID Utils
> > (http://www.gnu.org/software/idutils/4652) with Python?
>
> What exactly are you trying to accomplish?  If you want to index
> function/class names, variables, etc then you should take a look at
> "exuberant ctags" http://ctags.sourceforge.net53 --although it started
> off as a C indexer, it has excellent Python support, it's free, and as
> a bonus its indices are well supported from inside major editors (vim,
> emacs, etc) so you can easily follow code flow, find function/class
> definitions, etc.
>
> --
> http://mail.python.org/mailman/listinfo/python-list54
>


-- 
Ramon Diaz-Uriarte
Bioinformatics Unit
Spanish National Cancer Centre (CNIO)
http://ligarto.org/rdiaz



More information about the Python-list mailing list