2

I still feel a strong disturbance when it comes to auto-complete in emacs.
From what I have read in the docs, you can easily extend auto-complete by any syntax you like. Looking through (M)ELPA there are many packages named ac-[...], like ac-html-bootstrap.

After installing some of these packages, I am not sure if there is any difference, since auto-complete already shifts with various syntax.

General Question:
What is the general cookbook recipe for installing 3rd party syntax packages for auto-compete?

In more details:
(i) How does auto-complete get notified about 3rd party syntax packages in general? Does it scan the directory or do I need to specify it in my .emacs file?
(ii) How is it hooked to a certain mode or file extension? Is this provided by the syntax package itself or do I have to specify it?
(iii) How do I make sure, a package is correctly working? How do I tell the difference between the state without and with the package?

  • 1
    I don't use auto-complete so I can't speak to the majority of your questions but when installing something from melpa I always find that opening the readme from github is essential for proper installation – Jules May 25 '16 at 13:46
0

I posted this question on GitHub and received a nice answer by syohex:

(i) How does auto-complete get notified about 3rd party syntax packages in general? Does it scan the directory or do I need to specify it in my .emacs file?

Load 3rd party package in your configuration file. For example,

(require 'ac-html-bootstrap)

(ii) How is it hooked to a certain mode or file extension? Is this provided by the syntax package itself or do I have to specify it?

Add 3rd party source to ac-sources in specific mode hook(eg, python-mode-hook, ruby-mode-hook, etc). For example,

(require 'ac-c-headers) (defun my/c-mode-hook () (add-to-list 'ac-sources 'ac-source-c-headers)) (add-hook 'c-mode-hook 'my/c-mode-hook)

ac-sources is a buffer local variable so above configuration does not affect other major-mode buffers.

(iii) How do I make sure, a package is correctly working? How do I tell the difference between the state without and with the package?

You can get expected candidates then it looks working correctly. For example if you use go-autocomplete, then you should get candidates of Go methods, variable names, functions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.