开发者

emacs: is there a semantic-jump-to-declaration (using semantic.el)?

Suppose I am editing a buffer containing C code.

I have started semantic with semantic-load-enable-code-helpers .

I have point placed on the name of a function . If I then invoke senator-jump I can jump to the place where that fn is first declared, in that module. If there is an extern declaration in that module, then it goes to that extern statement. S开发者_运维技巧ometimes? Sometimes it doesn't work, though.

There is also semantic-ia-fast-jump, which jumps to the first declaration, also. I'm not sure how this fn differs from senator-jump. This one actually works all the time, though, for functions defined in the local buffer.

What if it the function I want to jump to, is an extern? Is it possible to use senator to jump to the definition of the fn, if that definition resides in a separate module? Isn't EDE supposed to do something like this?

Thanks.


Look to the semantic-ia-fast-jump function, defined in semantic-ia. For C & C++ it's also good idea to generate database with gtags from GNU Global - CEDET has support for it.

P.S. I just checked - it jumped from my source to declaration of std::string in /usr/include/....


I haven't used senator but doesn't etags work for you? I create a tags table of all .c. and .h files using

find . -name \*.c -o -name \*.h | xargs etags

and then use find-tag (bound by default to M-.) and jump to the appropriate definition. pop-tag-mark (bound by default to M-*) can be used to return to where you came from.

It works fine for me but I use it mainly while browsing large project codebases rather than which editing C.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜