I can’t get python-mode working in Emacs on Mac OS X (I am a relative OS X newbie & not exactly an Elisp expert).
I installed the Emacs from http://emacsformacosx.com/. The version is reported as “GNU Emacs 23.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2011-12-13 on bob.porkrind.org”
I have the following lines in my ~/.emacs file:
(add-to-list 'load-path "/Applications/Emacs.app/Contents/Resources/lisp/progmodes")
(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)
But whenever I load up a file with the .py extension, the mode still remains Fundamental.
Ok, so here’s how I got python-mode (
python-mode.el, notpython.elc) working on my install:~/Downloadsfolder.pushd /Emacs/directory/with/other/.el/files(this directory was actually/Applications/Emacs.app/Contents/Resources/lisp/progmodes/on my machine)tar -xzf ~/Downloads/python-mode.el-6.0.8.tar.gzpopdThen added the following lines to my
~/.emacsfile (replacing all other references to python or python-mode):The only remaining issue now — which was created by the successful install & activation of
python-mode— is that an unnecessary buffer also gets created with an interactive invocation of the Python interpreter.Thanks to @Ribtoks for the link that got me started along the correct path.