3

I tried make PythonIDE using emacs like in this article http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/ But emacs said me "auto-complete-mode not enabled". It is possible use emacs for python coding?

1 Answer 1

5

You want to activate the auto-complete mode in the context where you get that message, either

  • every time you open python files, by adding the following to your .emacs:

    (add-hook 'python-mode-hook
      (lambda ()
             (auto-complete-mode 1)))
    
  • or when you open any file, by adding the following to your .emacs:

    (global-auto-complete-mode t)
    

The question you're linking to suggests something even more complete (i.e. which subsumes the first of the two additions I suggest):

(add-hook 'python-mode-hook
      (lambda ()
             (auto-complete-mode 1)
             (set (make-local-variable 'ac-sources)
                  (append ac-sources '(ac-source-rope) '(ac-source-yasnippet)))
             (set (make-local-variable 'ac-find-function) 'ac-python-find)
             (set (make-local-variable 'ac-candidate-function) 'ac-python-candidate)
             (set (make-local-variable 'ac-auto-start) nil)))

Those additions will be needed to get full completion using snippets and Rope.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.