Through school I used Eclipse with Java, but I'm going embedded and picking up C and Emacs. I am looking for a way to achieve several functions of the project in Eclipse. Specifically the functions I miss are finding the declaration of a function that was declared in another file, and finding all calls to a function. Is there a way to achieve this? I don't mind using make files in order to compile, as it seems like the right tool for the job (besides my understanding is that if you use eclipse or visual studio for C they just auto generate you a make file anyway). I just can't help but feel some of the things mentioned above must have solutions in this editor as well, since they are just so handy.
-
2possible duplicate of [Emacs code completion for C/C++?](http://stackoverflow.com/questions/1285971/emacs-code-completion-for-c-c) – pmr Jan 31 '12 at 23:33
-
1Another possible duplicate: [code browsing, refactoring, auto completion in Emacs](http://stackoverflow.com/q/671412/790070) – Timothy Jones Jan 31 '12 at 23:41
-
Darn it I looked for other people asking this question and couldn't find it... – Irony Jan 31 '12 at 23:45
4 Answers
I'd suggest a combination of projectile + ctags + ECB (or just CEDET) + cscope.
Projectile offers easy navigation in a project's files and some nice functions like text search, tags regenerations, etc. ECB is an Emacs Code Browser that makes Emacs appear more IDE-like, CEDET will give you smart code completion and cscope will give you the ability to find usages (amongst other cool features).

- 55,802
- 13
- 100
- 117
For navigation in your source code, you might want to look at Ctags in emacs.
Once you've got it set up, you can use the following commands to jump to function implementation or variable/macro declarations:
M-. <RET> Jump to the tag underneath the cursor
M-. <tag> <RET> Search for a particular tag
C-u M-. Find the next definition for the last tag
M-* Pop back to where you previously invoked "M-."
For the other functions you mention, have a look at Cedet.

- 21,495
- 6
- 60
- 90
-
I find `etags-select` provides a better interface, and would recommend trying it: http://www.emacswiki.org/emacs/EtagsSelect – phils Feb 01 '12 at 09:38
Download XCsope.el and all your problems will be taken care by emacs.
I used to work on Source Insight for browsing, but now emacs + cscope is much better.

- 11
- 1