I am using Ubuntu 10.10 (Maverick Meerkat). I have downloaded python-mode.el
from Launchpad and placed it in emacs.d/plugins/
.
Now how do I install python-mode.el
?
Try this
(add-to-list 'load-path "~/.emacs.d/plugins")
(require 'python-mode)
I find it more convenient to have the appropriate editing mode auto-load based on the type of file edited. There are lots of ways to do this, but I usually add an entry to autoload-alist:
(and (library-loadable-p "python-mode")
(setq auto-mode-alist (append '(
("\\.py\\'" . python-mode)
)
auto-mode-alist)))
I have a long list of these for the various modes I like to use. It fails silently if python-mode (or any other mode) is not installed. If I'm running on an ISP sever that doesn't have a mode installed, I add ~/lib/elisp to the load-path and put the missing .el files in there.
library-loadable-p came from a friend and simply tests whether the file is somewhere in the load path:
(defun library-loadable-p (lib &optional nosuffix)
"Return t if library LIB is found in load-path.
Optional NOSUFFIX means don't try appending standard .elc and .el suffixes."
(let ((path load-path)
elt)
(catch 'lib-found
(while (car path)
(setq elt (car path))
(and
(if nosuffix
(file-exists-p (concat elt "/" lib))
(or (file-exists-p (concat elt "/" lib ".elc"))
(file-exists-p (concat elt "/" lib ".el"))
(file-exists-p (concat elt "/" lib))))
(throw 'lib-found t))
(setq path (cdr path))))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With