How can etags handle multiple directories
How it is possible under emacs and C++ to extend etags covering multiple directories? (I am not referring to recursive etgas which has a straight forward solution by using the -R option).
Something like this is needed, for example, in the case where we are using a third party library, including its headers, that could be installed anywhere i开发者_如何学Gon the directory structure.
An similar problem I am facing with emacs as a C++ editor is how to open an included header file directly from its #include directive.
This is trivial for IDE's (like VC_++) since the include headers path is part of the project but I cannot find a similar solution for emacs which as a thinner environment is not using the concept of a project....
Answering the main question: use find to traverse your directories Example in my tagging script:
find . \( -name "*[tT]est*" -o -name "CVS" -o -name "*#*" -o -name "html" -o -name "*~" -o -name "*.ca*" \) -prune -o \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.cxx" -o -iname "*.h" -o -iname "*.hh" \) -exec etags -a {} \;
Tip for C++ and solution for included header: see if cscope works better for you.
You might also look into GNU global instead of etags, as well as ff-find-other-file
and ffap
and related find-file-at-point functions to jump to the include file you're on. Both sets of functions have various customization options so you can tell them where to search for headers.
精彩评论