2

At some moment in time, auto-complete just stopped working for me. I added this code in my init file:

(global-auto-complete-mode t)

But I get this error when starting Emacs:

Symbol's function definition is void: global-auto-complete-mode

I can enable auto-complete on a per buffer basis, so I know it's installed and working. But I want it to be enabled globally by default.

  • 1
    Put (require 'auto-complete) before (global-auto-complete-mode t). – nicael Oct 10 '14 at 13:20
6

If the function isn't defined at startup, that probably means the file containing the function hasn't been loaded yet. The function global-auto-complete-mode is in the file auto-complete.el, which you can see with C-h f, so the first thing to try is to execute

(require 'auto-complete)

before calling the function.

  • Duh, that was it of course. Thanks! – Fernando Briano Oct 10 '14 at 13:25
  • 1
    If you install auto-complete from a package, that function will be autoloaded, so you won't need to explicitly require the library. – sanityinc Oct 10 '14 at 17:31

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.