Rope is a python refactoring library.
Ropemacs is the Emacs interface of rope, and ropemacs depends on pymacs.
Pymacs is used to connect Emacs and python. With pymacs, you can call python in Emacs.
To use ropemacs to complete python in Emacs, first install pymacs (of course, first ensure that python has been installed), and then install rope and ropemacs in sequence. Write down the following in. emacs:CodeTo set pymacs:
; Initialize pymacs
(Autoload 'pymacs-Apply "pymacs ")
(Autoload 'pymacs-call "pymacs ")
(Autoload 'pymacs-eval "pymacs" Nil T)
(Autoload 'pymacs-exec "pymacs" Nil T)
(Autoload 'pymacs-load "pymacs" Nil T)
Next, write the following code to set ropemacs:
; Initialize rope
(Pymacs-load "ropemacs" "rope -")
(Setq ropemacs-enable-autoimport T)
If you open the. py file later, emacs will add a rope menu. When editing python, press m-/to display Python completion.
PS: In OSX, an error occurs when Emacs starts rope because Emacs does not inherit the environment variable pythonpath from the system. Therefore, you must use setenv to set the environment variable pythonpath at the beginning of. emacs.
: we re-installed OSX today and found that the environment variable pythonpath is not required in osx10.5. 10.5 The default settings of Python-2.5.1 installed by default can be found in the installed rope/ropemacs. After the last installation, the rope encountered an error because a python-2.5.1 was not used, but a python-2.5.2 was re-installed. By default, rope/ropemacs was not found in Python-2.5.2. (In addition, osx10.5 has built-in wxPython-2.8.4 in Python-2.5.1 installed by default)