How etags handle multiple directories

How can I extend etags under emacs and C ++ to span multiple directories? (I mean non-recursive etgas that have a direct solution using the -R option).

Something like this is necessary, for example, in the case when we use a third-party library, including its headers, which can be installed anywhere in the directory structure.

A similar problem that I ran into emacs as a C ++ editor is how to open the included header file directly from its #include directive.

This is trivial for an IDE (e.g. VC _ ++), since the include header path is part of the project, but I cannot find a similar solution for emacs that does not use the project concept as a more subtle environment ....

+3
source share
2 answers

Answering the main question: use find to move your directories Example of my script tag:

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 a solution for the included header: see if cscope works .

+3
source

You can also look into the GNU global instead etags, and ff-find-other-fileand ffapand the related file search -point, to go to the included file where you are. Both feature sets have different settings, so you can tell them where to look for headings.

+2
source

Source: https://habr.com/ru/post/1768611/


All Articles