tar -xjf autocomplete.tar.bz2 #extract the tarball cd autocomplete/rope sudo python setup.py install #install rope cd ../ropemacs sudo python setup.py install #install ropemacs and ropemodeNext we need to install Pymacs and put the autocomplete files in the emacs configuration directory:
cd ../Pymacs-0.23
sudo python setup.py install #install pymacs
cp pymacs.el ~/.emacs.d
cp ../auto-complete.el ../auto-complete-config.el ~/.emacs.d
And finally, we have to put the following code into the .emacs file:
(add-to-list 'load-path "~/.emacs.d") (require 'auto-complete) (global-auto-complete-mode t) (require 'auto-complete-config) (ac-ropemacs-initialize) (global-auto-complete-mode t) (define-key ac-complete-mode-map "\t" 'ac-expand) (define-key ac-complete-mode-map "\r" 'ac-complete) (define-key ac-complete-mode-map "\M-n" 'ac-next) (define-key ac-complete-mode-map "\M-p" 'ac-previous) (setq ac-auto-start 3) (setq ac-dwim t) (set-default 'ac-sources '(ac-source-abbrev ac-source-words-in-buffer)) (setq ac-modes (append ac-modes '(eshell-mode )))
(set-face-background 'ac-menu-face "lightgray") (set-face-underline 'ac-menu-face "darkgray") (set-face-background 'ac-selection-face "steelblue")Obviously, you can change the colors to whatever you want. And one final hack. Whenever you open a python file for the first time in an emacs session and press the '.' key, rope is activated and it will ask you for a location for the rope project file. For some reason, when I press RET and choose the default I get an error. If, on the other hand, I first go back to the main buffer (C-x o), and then switch back to the minibuffer and hit RET (C-x o RET), then it works.