summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1996-08-01 20:02:55 (GMT)
committerBarry Warsaw <barry@python.org>1996-08-01 20:02:55 (GMT)
commit755c6714cc1d65440931262942b442f7ca012369 (patch)
tree53c1fea014df4cfb24ae126fd438079574322ab0 /Misc
parent8143746750725fb90d2cde733047ae7d7503a9a4 (diff)
downloadcpython-755c6714cc1d65440931262942b442f7ca012369.zip
cpython-755c6714cc1d65440931262942b442f7ca012369.tar.gz
cpython-755c6714cc1d65440931262942b442f7ca012369.tar.bz2
(python-mode): automatically install imenu stuff.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/python-mode.el23
1 files changed, 15 insertions, 8 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index 42b112d..8683e15 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -18,17 +18,18 @@
;;; Commentary:
;;
+
;; This is a major mode for editing Python programs. It was developed
-;; by Tim Peters <tim@ksr.com> after an original idea by Michael
-;; A. Guravage. Tim doesn't appear to be on the 'net any longer so I
-;; (Barry) have undertaken maintenance of the mode.
+;; by Tim Peters after an original idea by Michael A. Guravage. Tim
+;; left the net for a while and in the interim, Barry Warsaw has
+;; undertaken maintenance of the mode.
;; At some point this mode will undergo a rewrite to bring it more in
-;; line with GNU Emacs Lisp coding standards. But all in all, the
-;; mode works exceedingly well, and I've simply been tweaking it as I
-;; go along. Ain't it wonderful that Python has a much more sane
-;; syntax than C? (or <shudder> C++?! :-). I can say that; I maintain
-;; cc-mode!
+;; line with GNU Emacs Lisp coding standards, and to wax all the Emacs
+;; 18 support. But all in all, the mode works exceedingly well, and
+;; I've simply been tweaking it as I go along. Ain't it wonderful
+;; that Python has a much more sane syntax than C? (or <shudder> C++?!
+;; :-). I can say that; I maintain cc-mode!
;; The following statements, placed in your .emacs file or
;; site-init.el, will cause this file to be autoloaded, and
@@ -696,6 +697,12 @@ py-beep-if-tab-change\t\tring the bell if tab-width is changed"
(if py-beep-if-tab-change (beep)))))
(goto-char start))
+ ;; install imenu
+ (setq imenu-create-index-function
+ (function imenu-example--create-python-index))
+ (if (fboundp 'imenu-add-to-menubar)
+ (imenu-add-to-menubar (format "%s-%s" "IM" mode-name)))
+
;; run the mode hook. py-mode-hook use is deprecated
(if python-mode-hook
(run-hooks 'python-mode-hook)