Autocomplete using Emacs 24 does not apply to Java, C, or C mode

I used marmalade buy back to install autocomplete Everything was installed correctly, and after moving something, I managed to start and run AutoCorrect without any errors with my init The following code in El:

;; auto-complete
(add-to-list 'load-path "~/.emacs.d/elpa/auto-complete")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/elpa/auto-complete/dict")
(ac-config-default)

Now I can use autocomplete instead of Emacs lisp, but whenever I use any other mode, such as Java, C or C, it doesn't work at all

I also installed yasnippet (it works well), and I'm not sure if it has anything to do with it This is my init Relevant codes in El:

;;yasnippet
(add-to-list 'load-path
              "~/.emacs.d/plugins/yasnippet")
(require 'yasnippet)
(yas-global-mode 1)

I'm learning Emacs. At present, I'm still a rookie I've been looking at the documents and so, but I can't find anything I really appreciate any help

Solution

You may need to add a completion source This is the content of my configuration:

(set-default 'ac-sources
             '(ac-source-abbrev
               ac-source-dictionary
               ac-source-yasnippet
               ac-source-words-in-buffer
               ac-source-words-in-same-mode-buffers
               ac-source-semantic))

Update: AC config default should contain this content, but if autocomplete does not activate these modes, please try in init Add the following to El:

(dolist (m '(c-mode c++-mode java-mode))
  (add-to-list 'ac-modes m))

(global-auto-complete-mode t)

Update2: I released a gist that makes your init El can use package install to extract autocomplete functions

I don't know what version of autocomplete you quoted, but the latest version is good for me

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>