Using ETAGS/CTAGS in emacs with C++ Project
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?
eg
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
来自CEDET的语义应该提供相应的功能......请查看本节并阅读“语义用户指南”以获取更多详细信息...
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
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 "Cu 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...
链接地址: http://www.djcxy.com/p/38578.html