ant2009
ant2009

Reputation: 22486

Finding where varables have been declared in what file?

GNU Emacs 23.1.1

I am maintaining someones code. There are many files and directories for the headers and source files.

I am wondering if there is a easy way to use emacs that when I highlight a variable name I can go straight to where it is declared?

Some of the structures I am working in are declared in other header files, rather than go searching for them, I just want to be taken straight to them.

Many thanks for any suggestions,

Upvotes: 3

Views: 115

Answers (2)

Drew
Drew

Reputation: 30701

It's also pretty easy to hit C-h v RET on the variable name, to get its *Help*, then hit RET (or click) the file-name link to get to the source definition.

Upvotes: 0

Anders Abel
Anders Abel

Reputation: 69260

Look into the etags command which builds a tags database. Once the tag DB is built and loaded, you can use M-. on any keyword to jump directly to the definition.

Upvotes: 4

Related Questions