简体   繁体   中英

Using ropemacs for autocompletion with python.el in Emacs

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).

eg

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).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM