3

How do I set up auto-complete to use ropemacs with python.el in Emacs 24?

I have the following in my .emacs file

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

; Auto-complete rope integration:
; --------------------------
(ac-ropemacs-initialize)
(add-hook 'python-mode-hook
      (lambda ()
    (add-to-list 'ac-sources 'ac-source-ropemacs)))

but this does not seem to be enough to get autocompletions of Python methods, class members, etc. (on the auto-complete tooltip).

e.g.

my_text = "hello world"
my_text.

does not show any possible autocompletions for the String class.

With the above config, auto-complete itself works well for generic auto-completions (and for directories).

Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564

1 Answers1

6

If I may suggest, try emacs-jedi if you just want auto completion, and documentation help.

It is relatively new and in early development stage matured and reliable enough to work with, way better than the rope route.

kindahero
  • 5,817
  • 3
  • 25
  • 32
  • Thanks! Why is it a better route than rope? What are the differences? – Amelio Vazquez-Reina Nov 03 '12 at 12:36
  • 2
    @user273158 two reasons, 1) Its specifically written for auto-completion support for python, a wrapper to jedi (https://github.com/davidhalter/jedi). 2) the author of the package is super active. – kindahero Nov 03 '12 at 20:41
  • I fully agree; I was trying ropemacs after hours of setting up, and it was awfully slow, so after seeing this I tried emacs-jedi and everything is just pure awesome now. – altschuler Dec 21 '12 at 00:10
  • agreed. never could get ropemacs set up. I tried for an entire 8 hour workday. Sorry ropemacs. – user798719 Jun 23 '13 at 04:35