Pymacs: general question and installation issue

I am trying to configure emacs for python development.

From what I read, it is recommended to use python-mode.el, not the default python.el from Emacs 22.3. So I'm embarking on a new adventure.

From what I understand, python-mode has several dependencies, so I need to install rope, ropemode and ropemacs. Then, in addition, I need to install pymacs.

Q: is this correct?

Now these are my new .emacs:

(custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(inhibit-startup-screen t) '(tab-width 4)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) (setq emacs-config-path "~/.emacs.d/") (setq base-lisp-path "~/.emacs.d/site-lisp/") (setq site-lisp-path (concat emacs-config-path "/site-lisp")) (defun add-path (p) (add-to-list 'load-path (concat base-lisp-path p))) (add-path "") (add-to-list 'load-path "~/.emacs.d") (require 'psvn) ;; python-mode ;; (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)) (setq interpreter-mode-alist (cons '("python" . python-mode) interpreter-mode-alist)) (autoload 'python-mode "python-mode" "Python editing mode." t) (setq pymacs-load-path '( "~/.emacs.d/site-lisp/rope" "~/.emacs.d/site-lisp/ropemode" "~/.emacs.d/site-lisp/ropemacs")) (setq interpreter-mode-alist (cons '("python" . python-mode) interpreter-mode-alist) python-mode-hook '(lambda () (progn (set-variable 'py-indent-offset 4) (set-variable 'py-smart-indentation nil) (set-variable 'indent-tabs-mode nil) ;;(highlight-beyond-fill-column) (define-key python-mode-map "\Cm" 'newline-and-indent) (pabbrev-mode) (abbrev-mode) ) ) ) ;; 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) ;; Search local path for emacs rope ;; ;; enable pymacs ;; (require 'pymacs) (pymacs-load "ropemacs" "rope-") 

Now when I start emacs, I got this error message:

 ("C:\\opt\\emacs-22.3\\bin\\emacs.exe") Loading encoded-kb...done Loading regexp-opt...done Loading easy-mmode...done Loading wid-edit...done Loading edmacro...done Loading derived...done Loading advice...done Loading cl-macs...done Loading byte-opt...done An error has occurred while loading `c:/opt/cygwin/home/akong/.emacs': File error: Cannot open load file, pymacs To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the `--debug-init' option to view a complete error backtrace. For information about GNU Emacs and the GNU system, type Ch Ca. [2 times] 

To make this a little harder:

For work reason, I should use python 2.4, but I have python 2.6 installed on my PC. But obviously the rope does not like 2.4, so I did not run setup.py. I will unpack / unpack these packages and put these files in ~ / .emacs.d / site-lisp. By default, if python is invoked on the command line, it is the python 2.4 executable.

Q: How can I successfully download "pymacs"?

+6
python emacs rope pymacs
source share
3 answers

Turns out I skipped these two:

 (add-to-list 'load-path "~/.emacs.d/site-lisp/Pymacs-0.23") 

Obviously, I need to download a pymac script.

And I set env var PYMACS_PYTHON in python 2.6 because I use python 2.4 as the default python interpreter to work.

+1
source share

I never used pymacs, but one thing that catches your eye when I look at your .emacs is that you apparently did not add the pymacs directory to the emacs load-path , but only to pymacs alone:

 (setq pymacs-load-path '( "~/.emacs.d/site-lisp/rope" "~/.emacs.d/site-lisp/ropemode" "~/.emacs.d/site-lisp/ropemacs")) 

You will probably also need something like:

 (add-to-list 'load-path "~/.emacs.d/site-lisp/rope") (add-to-list 'load-path "~/.emacs.d/site-lisp/ropemode") (add-to-list 'load-path "~/.emacs.d/site-lisp/ropemacs") 

(or if you have pymacs.el ) so that emacs can find lisp files. Also mentioned in pymacs documentation

2.4 Establish the correct Pymacs ... for the Emacs part ...

This is usually done manually. First, select some directory along the list stored in your Emacs boot path for which you have to write, and copy the pymacs.el file in this directory.

+1
source share

If there are no paths, this will be easily seen in the startup log or by getting backtrace when emacs starts. If in doubt, the Mx load-library is the way to go.

I, too, get a refusal from ropemacs to download both emacs 23 and emacs 24 after the latest Debian testing updates, which means that you cannot save files due to rope bindings. I would be interested to hear from someone with whom he worked. Ropemacs and python in general with emacs have long been spikes. I am going to try and debug it a bit later and update this thread.

+1
source share

All Articles