I use Pymacs to load ropemacs and rope with the following lines in my .emacs file as described here.
(autoload 'pymacs-load "pymacs" nil t)
(pymacs-load "ropemacs" "rope-")
It however slows down the start-up of Emacs significantly as it takes a while to load Ropemacs.
I tried the following line instead but that loads Ropemacs every time a Python file is opened:
(add-hook 'python-mode-hook (lambda () (pymacs-load "ropemacs" "rope-")))
Is there a way to perform the pymacs-load
operation when opening a Python file but only if ropemacs and rope aren't loaded yet?
eval-after-load
runs only once, so it is ideal for initially configuring a mode. – Contingent