I am seeking a plugin to do autocompletion popup for c++ development in emacs. what I have tried are Cedet Semantics and the Autocompletion mode, they are pretty neat in terms of completing the variable and function names as long as I have a few words already. For example, I have a class named foo and a function that returns an integer 1
class foo{
int getInt(){return 1};
};
In the main method, so long as I started typing this
int main(){
foo bar;
bar.get...
}
the plugins have no problem popping up suggestions like bar.getInt(). However, what I am really looking for is something like in Eclipse, as soon as I press the "dot", possible choices could be generated for me. Is that possible in Emacs? Thanks
I have found that cedet is really underwhelming, especially under cmake projects.
I would recommend using https://github.com/Andersbakken/rtags It underlines errors as you type as well as using smart completions. Just add this to your init file after obtaining the required emacs packages
It depends on your settings of auto-complete & CEDET. It looks like that auto-complete is setup to show possible completions only after several characters will be typed. You can check value of the
ac-auto-start
variable - if this is a number, then auto-complete will be called after this number of characters. Another important thing is a what is in yourac-sources
variable - for work with CEDET you need to useac-source-semantic-raw
orac-source-semantic
completion source. To automatic completion after.
or->
you can try to use Semantic's built-in completion with something like:P.S. Had you seen my article on CEDET & C++?