27

I recently switched to Emacs and still finding my way through it. I code in C++ and was wondering what tools out there extend Emacs to support code browsing (finding a symbol etc), refactoring and code completion. I have heard of:

  • cedet
  • etags
  • cscope

But I'm so confused about what I need. Some places say that cedet provides all of the functionality but other places say that I need to invoke etags for cedet to work properly.

Can someone clear this up for me? Do I need all of these tools?

George Stocker
  • 57,289
  • 29
  • 176
  • 237
Idan K
  • 20,443
  • 10
  • 63
  • 83

6 Answers6

17

Maybe you will find my article about Cedet useful. Cedet has support for etags, gtags, cscope and other tools.

But refactoring is missing. You may need to look into the Xrefactory tool (but it isn't free)

SullX
  • 214
  • 4
  • 17
Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • I have re-config the cedet for my emacs acorrding to you guide and config files. Oh, greate. Thank you very much. – Yantao Xie Aug 27 '09 at 09:30
6

Cscope is very good as "find symbol" usage tool. It is very fast.
Etags will show you your class hierarchy and will help you to find method definition/declaration.

So these two tools are must have and they are independent.

Cedet. It is kind of replacement of these two tools above with additional features. So your choice either cscope/etags or cedet.

Mykola Golubyev
  • 57,943
  • 15
  • 89
  • 102
3

For refactoring, I started using emacs exclusively for this and related tasks after I read this article by emacs hacker Xah Lee.

For autocompletion, see this SO post. Personally, I've found yasnippet very helpful throughout the years.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Steen
  • 6,573
  • 3
  • 39
  • 56
2

gtags (http://www.gnu.org/software/global/) is also available and perhaps simpler to use.

1

Personally, I don't like cedet. It makes Emacs take an hour to load. The auto-complete feature has never worked quite right with me. I don't need its project-management nor its UML features. The only thing I miss about it is the Emacs Code Browser, which is very useful but requires cedet

I would advice you to just use cscope and etags and see how you like them. You can install cedet later once you're more familiar with emacs.

bigmonachus
  • 993
  • 8
  • 15
  • 2
    You can use only needed parts of Cedet. Name completion works fine in latest versions of Cedet (but may be you'll need to perform some customization) – Alex Ott Mar 23 '09 at 10:53
0

I wrote a blog article about using Global/gtags and Speedbar for code browsing you might find useful... (I also thought CEDET was a bit slow... and extremely complicated to set up =)

gulchrider
  • 4,306
  • 3
  • 25
  • 16