Monday, March 9, 2009

Using tags in emacs on windows




This requires you install the Gunwin32 tools or Cygwin, and describes how to build a tags table for the project you're working on, when using emacs to edit the source.

First you want to generate a file containing all the source files you want to have tagged. Go to the root folder of your project.
find . -regex ".*\(h$\|cpp$\)" > files.txt
Next pass this to etags to generate the tags table.
etags.exe - < files.txt 

Then when you're in emacs you need to visit the tags table, which will have been saved as TAGS. M-x visit-tags-table then browse to the folder where you made the TAGS file. Now when you have the curser on some function you can type... M-. to go to a tag and C-u M-. to go to the next tag. Once you're done, you can return to where you started with M-* Another useful function is tags-apropos Which will list all the tags matching a regex in a buffer.

No comments: