emacs, etags and using emacs as an IDE
Asked Answered
L

2

13

My usual tools are Emacs with g++ on a Linux system to implement my research algorithms. For the last some years, I have used emacs in a fairly basic way. I open C or C++ files, edit them with a syntax highlighting scheme of my choice and compile and do other stuff from within emacs (or maybe from a terminal), including using gdb within emacs for debugging. I know about etags and ctags and have played a bit with etags and emacs but don't seem to find that "sweet spot" with the tools.

I was wondering, what do others do to configure emacs just so that it meshes nicely with etags and other tools? What tweaks does one need to do to emacs to make it a better IDE?

Lsd answered 21/10, 2009 at 1:51 Comment(0)
W
16

For just tagging info, I also recommend GNU Global. CScope can do a lot also. In both cases, they provide a way to find the location of a tag by name, and also the uses of a particular tag.

For "IDE Stuff" there is more to it than just a tagging system. For that, I recommend the CEDET set of tools for Emacs. This provides a project management system (EDE) which can create Makefiles to compile your code for you. There is also a parsing and code analysis part (Semantic) which provides smart completion. There is a template / code generation system (SRecode) which can convert tags from semantic back into code. There is even a UML diagram editor (COGRE) which can generate code from a class diagram that you draw in Emacs.

Most people using CEDET only use the parser and smart completion systems, possibly in combination with ECB, and it is ok to use only a subset of CEDET.

For good measure CEDET will also integrate with GNU Global databases so you can reference symbol uses in addition to tag locations along with the regular GNU Global interface for Emacs.

Weaken answered 21/10, 2009 at 4:11 Comment(1)
2samix: may be you'll find useful my article about CEDET - xtalk.msk.su/~ott/en/writings/emacs-devenv/EmacsCedet.htmlBrooklyn
H
3

We've recently started using GNU Global as a replacement for etags, and I've been pretty impressed. We also use idutils which provides a fast way to search for any strings in the source code.

Headforemost answered 21/10, 2009 at 2:41 Comment(4)
Could you elaborate a bit on why you appear to prefer Gnu Global over etags? In fact, this is the first time I am hearing about Gnu Global and know nothing about it. I wonder how it compares with Etags. From Gnu Global's website I know that it supports fewer languages, but I am mostly interested in C and C++ so that is not a prblem. Thanks.Lsd
much faster search, gtags are also used in CEDET and allows to find calls to specific functions, etc..Brooklyn
I agree with Alex, gtags are much faster than etags and generally more accurate. I did find a few issues where it was incorrectly parsing code, but for the most part it works well.Headforemost
Thanks guys, just installed "global" package on my Debian machine to start playing around with it :)Lsd

© 2022 - 2024 — McMap. All rights reserved.