| ★ wanayoo — archive 1999 http://www.python.org/emacs/python-mode/installation.html | Nouvelle recherche | Portail wanayoo |
![]() |
|
||||||||||||||
|
Installation NotesByte CompilingYou will want to byte-compilepython-mode.el,
primarily for better performance. Do this by running the
following commands inside X/Emacs:
C-x C-f /path/to/python-mode.el RET M-x byte-compile-file RETYou can safely ignore any byte compiler warnings; they are due to the cross X/Emacsen support. Be sure to see the list of compatibility issues, for special notes about X/Emacs versions and package interactions. |
load-pathpython-mode.el is on your load-path,
before any version that is distributed with your X/Emacs.
You can use this test:
M-x locate-library RET python-mode RETMake sure this finds the one you expect it to find. If not, you can add this to your
.emacs file:
(setq load-path (cons "/dir/of/python-mode/" load-path))
.py files
with python-mode so that Emacs sets the
major mode properly when you visit such files. This is controlled
by two variables, auto-mode-alist and
interpreter-mode-alist. Add the following to your
.emacs file:
(setq auto-mode-alist
(cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
(cons '("python" . python-mode)
interpreter-mode-alist))
You don't need to do this for XEmacs, since as of at least XEmacs
19.15, these file associations are set by default.
python-mode with the file
python-mode.elc. You do this by setting up an
autoload by adding this to your .emacs
file:
(autoload 'python-mode "python-mode" "Python editing mode." t)Again, you only need to do this with Emacs, since as of at least XEmacs 19.15, this autoload is set up by default.