Faster python development with etags

Thu Nov 6, 2008

Been doing more and more with python the last few months. Now my projects are getting larger, and it’s not as easy to remember where everything is.

Emacs has the ability to read a TAGS file and then if you want to jump to the definition of something, hit M-. and it’ll jump to the spot in the file which defines it. My way of generating the tags file is not completely hooked up to namespaces, but if I need that, I might invest some time into figuring it out in the future. Actually, this would be a good intern project – have them create a python script to add namespacing in, and django settings file definitions into the TAGS file.

I run this nightly on our source trees for the various projects, then when moving from project to project, you adjust your tags-table-list when you start to work on a different project. I like to keep the tags files named TAGS because it is easy to know where it is. Some people like to load all of them, but I like to keep it to just one project at a time.

find . -name "*.py" | etags --output TAGS -

Will generate a tags file for you. I suggest running it in a cron on a separate working directory which does an svn update nightly or a git checkout depending on the project.