Search autocomplete function in emacs

I am looking for a plugin to create an autocomplete popup for developing C ++ in emacs. what I tried is Cedet Semantics and autocomplete mode , they are pretty neat in terms of completing variable and function names, if I already have a few words. For example, I have a class called foo and a function that returns the integer 1

class foo{
   int getInt(){return 1};
};

In the main method, while I started typing this

int main(){
 foo bar;
 bar.get...
}

plugins have no problems with the appearance of sentences like bar.getInt (). However, what I'm really looking for is similar to Eclipse, as soon as I click the dot, possible options can be created for me. Is this possible in Emacs? Thanks

+5
source share
2 answers

CEDET. , . ac-auto-start - , . - , ac-sources - CEDET ac-source-semantic-raw ac-source-semantic. . -> Semantic - :

(defun my-c-mode-cedet-hook ()
 (local-set-key "." 'semantic-complete-self-insert)
 (local-set-key ">" 'semantic-complete-self-insert))
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook)

P.S. CEDET ++?

+2

, cedet , cmake.

https://github.com/Andersbakken/rtags , . emacs.

(require 'rtags)
(require 'popup)
(require 'rtags-ac)
(setq rtags-completions-enabled t)
(rtags-enable-standard-keybindings c-mode-base-map)
(add-hook 'c++-mode-hook
          (lambda ()
            (setq ac-sources '(ac-source-rtags)
)))
0

All Articles