3
votes

Could anyone help me out in configuring auto-complete-clang for Emacs on Ubuntu? I am a newbie to Emacs. I have auto-complete working, and Yasnippet, and i can also compile code with clang++, i just can't get auto-complete-clang to work. Any help in this configuration would be appreciated.

right now my .emacs file looks like:

;; Auto Complete
(add-to-list 'load-path
        "~/.emacs.d/elpa/auto-complete-20130724.1750/")
(require 'auto-complete-config)
(add-to-list 'load-path
        "~/.emacs.d/elpa/auto-complete-20130724.1750/dict/")
(ac-config-default)
;; Yasnippet
(add-to-list 'load-path
        "~/.emacs.d/elpa/yasnippet-20131014.928/")
(require 'yasnippet)
(yas-global-mode 1)
;; Autocomplete Clang
(add-to-list 'load-path
        "~/.emacs.d/elpa/auto-complete-clang-20120612.2224/")
(require 'auto-complete-config)
(require 'auto-complete-clang)
1
Can you show your steps which you followed to configure? So that here others can help you.NullPointer
the auto-complete in emacs?anacy
I dont know why it's running all the code together like thisanacy
oh, ok... It just doesnt seem to give me any clang auto-complete options. The auto-complete works the same even if i take out the auto-complete-clang fileanacy
Some reading on clang autocompletion suggests that you'd need to have a project / makefile for the compiler to make some sense of your code. Some more debugging you could do, in the buffer with your code: M-: ac-sources if it lists something that has clang in it, you are fine. Another thing to try: C-h f ac-clang-candidate then instrument it for debugging: C-u C-c f and see if it is entered when autocompleting something in your code.user797257

1 Answers

0
votes

Im not really sure what i did, but it is working now.. I reall just changed the key-binding to call auto-complete clang, and added auto-complete-clang to my autocomplete sources( which wasn't working initially ), but all seems to be well now.. Thanks for all the advice.