What can you recommend me ?
-
3Similar: http://stackoverflow.com/questions/671412/code-browsing-refactoring-auto-completion-in-emacs – dmckee --- ex-moderator kitten Aug 17 '09 at 02:54
-
2autocomplete package could also take information from Cedet/Semantic. For which language do you want to use auto completion? Xrefactory, as i remember is non-free – Alex Ott Aug 17 '09 at 11:48
-
Thanks Alex, your tutorial was very helpful :) – ZeroCool Aug 17 '09 at 13:56
-
1I almost freaked out 'cause at first I read it "Emacs code COMPILATION for C/C++".. I was like "It compiles C/C++ code, too?!?!" Thank God I had read it wrong! – Leo Jweda Aug 22 '09 at 13:16
7 Answers
You can try company-mode. It's a multi-backend in-buffer completion mechanism.
Watch the screencast to get an idea of how it works.
Some of the back-ends are:
- CEDET Semantic
- dabbrev
- XCode
- PySmell
- Ropemacs
- GNU Global
And it's also available via ELPA.

- 2,749
- 20
- 21
-
Any tutorials on how to install CEDET or GNU Global, and get them working with company-mode? Those don't seem to be available in ELPA – wrongusername Jan 14 '12 at 01:03
You could also use an autocomplete plugin for clang as long as your source compiles with it. links:

- 2,496
- 1
- 20
- 21
GCCSense
From the author of Auto Complete Mode. It uses gcc to find candidates for code completion as the name suggests.

- 21,988
- 13
- 81
- 109

- 399,953
- 195
- 994
- 1,670
-
1#archeology I tried several times (2 or 3) to use GCCsense during the last 10 years without success. Did you actually manage to set it up and make it works properly. Is the completion OK now? The fact that private data appear in the sample completion is not good sign... – log0 Mar 02 '12 at 13:07
-
-
CEDET is just great, certainly needs some time at the beginning but worth it though.

- 1,490
- 4
- 19
- 33
I tend to use etags.
For emacs integration: http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/etags.html
For how to run etags. http://www.delorie.com/gnu/docs/emacs/etags.1.html
As a bonus, this blog post describes a bit more emacs setup and how to use etags. http://tulrich.com/geekstuff/emacs.html
Edit: To answer the comment, after runnning etags across your code, you can complete words with C-x t(that's what it's bound to on my machine.) Or you can call the tag-search method.

- 7,834
- 11
- 55
- 85
-
Yeah that's what I actually use, but as far as I can see, doesn't provide code completion feature. Does it ? – ZeroCool Aug 21 '09 at 14:15
-
-
1
to be honest for i like plain old dabbrev-expand (M-/), yes it doesn't use any contextual information other than what characters are adjacent in the open buffers, but on the plus side it doesn't use any contextual information ;) this means you can complete from text you have written first in tests or comments.
for other options http://www.emacswiki.org/emacs/CategoryCompletion

- 13,817
- 5
- 37
- 50
When I'm editing python code in Emacs, I like and use pysmell for code completion:

- 5,656
- 3
- 22
- 19