2

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?

2 Answers 2

4

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
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.