Question

I generated a TAGS file with etags, including several directories in the directory of a library I'm using. The command was something like:

etags *.h *.cpp /path/to/library/include/* /path/to/library/libsrc/*.cpp

When I call emacs' find-tag function M-., I never get matches to tags from the .h files.

How can I jump to the declaration of a function from it's use in some code?

Was it helpful?

Solution

This is a bit on the late side, but function declarations are by default not included when building etags. Add --c++kinds=+p to include them:

etags --c++kinds=+p *.h *.cpp /path/to/library/include/* /path/to/library/libsrc/*.cpp

OTHER TIPS

By default, M-. jumps to the definition. I've found that adding a prefix (C-u M-.) after jumping to the definition generally goes to the declaration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top