Thread: [cedet-semantic] C++ browsing: etags & semantic
Brought to you by:
zappo
From: Tomas O. <tom...@te...> - 2004-12-20 13:13:09
|
NachrichtHi, I used to program in C over Unix, and was very happy with XEmacs & etags browsing. However, when I moved to C++ I tried to use etags with c++, but it didn't work fine for me. It worked in a way, but kind of annoying. Sometimes, when positioned over a class type A, it didn't jump to its definition, and instead it jumped to the atrributte of other class B that was of type ' ptr to A' . Don't know why is that, but it gets confused too much to be useful. 1) If any of the 'gurus' around here knows if this is the right behaviour for etags, or it is just my fault, please, tell me! And point me what should I pay attention to... (I generate the TAGS file with find . \( -name "*.cc" -o -name "*.hh" -o -name "*.h" -o -name "*.c" \) -exec etags --c++ --members -a {} \; ) Now, I'm programming in C++, and using ECB (Emacs Code Browser) as browser. I use the Methods buffer (that uses semantic). But sometimes, I miss the cool feature of jumping to other files definitions, just as it was when I worked with etags in plain C. 2) I'm wondering if it is possible to do it with semantic, or I will find the same problems as with etags. Can anyone refer me to a place in the manual, or give me pointers where I can get more info about how to configure it? (Better if it is with less pain... ;-) Thanks in advance, Tomas. |
From: Eric M. L. <er...@si...> - 2004-12-22 14:58:32
|
>>> "Tomas Orti" <tom...@te...> seems to think that: >NachrichtHi, >I used to program in C over Unix, and was very happy with XEmacs & etags >browsing. >However, when I moved to C++ I tried to use etags with c++, but it didn't >work fine for me. >It worked in a way, but kind of annoying. Sometimes, when positioned over a >class type A, >it didn't jump to its definition, and instead it jumped to the atrributte of >other class B that was >of type ' ptr to A' . Don't know why is that, but it gets confused too much >to be useful. > >1) If any of the 'gurus' around here knows if this is the right behaviour >for etags, >or it is just my fault, please, tell me! >And point me what should I pay attention to... >(I generate the TAGS file with >find . \( -name "*.cc" -o -name "*.hh" -o -name "*.h" -o -name "*.c" >\) -exec etags --c++ --members -a {} \; >) Hi, That is indeed what Etags is likely to do. You can use C-u M-. to keep jumping about till you find the specific definition you want. >Now, I'm programming in C++, and using ECB (Emacs Code Browser) as browser. >I use the Methods buffer (that uses semantic). >But sometimes, I miss the cool feature of jumping to other files >definitions, >just as it was when I worked with etags in plain C. The "senator" part of semantic has two "jump" functions defined. There is "C-c , j" which is "local jump" within that file, and "C-c , J" which lets you jump to symbols across multiple files. The completion for the later is a little different and allows you to "focus" on a specific definition that has the same name as other symbols in other files. As with most things in semantic, it will only identify symbols in files Emacs has previously visited. Eric -- Eric Ludlam: za...@gn..., er...@si... Home: http://www.ludlam.net Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net GNU: www.gnu.org |