ocaml-opam / opam-user-setup

Simplify the configuration of editors for using OCaml tools
Other
81 stars 12 forks source link

autocomplete doesn't work in emacs #25

Open yminsky opened 8 years ago

yminsky commented 8 years ago

The emacs autocomplete setup doesn't seem to work for me. I'm running:

GNU Emacs 24.4.1 (x86_64-pc-linux-gnu)

It complains with this when I try to auto-complete:

Symbol's function definition is void: auto-complete

As a side note, I wonder if the default auto-complete is the right choice for completion. At work, we use company-mode (short for "complete anything". Sigh.) which seems to work quite well.

AltGr commented 8 years ago

did you have merlin, ocp-index, or both installed ? They each have their own setup for completion. What user-setup does is enable it -- disabling that of ocp-index when merlin is installed to avoid conflicts. Both support auto-complete and company -- and will choose what is available; but the former appears to be more widespread, so that may be the reason why you ended up with it. I am not sure what the default is if both are found -- did you check what packages are available on your emacs ?

AltGr commented 8 years ago

I tested this some more on a fresh system, and Symbol's function definition is void: auto-complete happens... when auto-complete isn't installed on the system. Which makes perfect sense.

I'll investigate where this is raised from, and polish the result in this case. I don't think it could be wise to include auto-complete or company, but we could at least print a nicer message on what to do! After all nowadays it's just a M-x package-install company away. Another possibility would be to point to the system package for either in depexts:; but there is no "either" there, so that's annoying.

yminsky commented 8 years ago

That sounds reasonable. It's worth noting that, even after installing company-mode, it didn't magically work, and it wasn't obvious to me how to get it working with company mode.

My weakly held view is that if we need to pick one, company mode is the superior choice, and so it would be reasonable to make that the default if that made it easier. But something needs to be done to make this smoother.