Im using emacs and etags to navigate my way round a project, is it possible to get to a header file easily by searching for a function. I have been using VisualStudio and I can view it by clicking goto declaration is there a similar way using etags in emacs?
e.g.
ArchiveDialog::onKeyPress()
search for the declaration of onkeypress that will be in the header file of ArchiveDialog (#include at the top of the source file).
at the moment when im using etags "M-. onKeyPress" will just find the tags in cpp files and not my header files.
Any help would be appreciated Thanks
Semantic from CEDET should provide corresponding functionality... Please, look onto this section and into "Semantic User's Guide" for more details...
Yes, I believe so.
First you should know, there are 2 versions of etags. There is the one that ships with emacs, and the version of etags that comes with Exuberant Ctags.
http://ctags.sourceforge.net/
You want the second version of etags. That version has more options, including an option to tag function prototypes.
I think this option may work for you, although I have not tested it:
--C++-kinds=+p
Once declarations are tagged, both will show up as results when you try to jump to a tag. If you land on the declaration when you want the definition, or vice versa, type "C-u M-." to go to the next match.
I think GNU Global may also let you jump to declarations, although its been a while since I used it. However, Global's C++ parser has some bugs...
From your description, it sounds like you might have run etags on the source file(s), but didn't specify the #include file(s). Assuming your header (#include) files have '.hh' suffix and are in the same directory as your source, do the following:
cd $project_directory
etags --append *.hh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With