Kaydet (Commit) 755c6714 authored tarafından Barry Warsaw's avatar Barry Warsaw

(python-mode): automatically install imenu stuff.

üst 81437467
...@@ -18,17 +18,18 @@ ...@@ -18,17 +18,18 @@
;;; Commentary: ;;; Commentary:
;; ;;
;; This is a major mode for editing Python programs. It was developed ;; This is a major mode for editing Python programs. It was developed
;; by Tim Peters <tim@ksr.com> after an original idea by Michael ;; by Tim Peters after an original idea by Michael A. Guravage. Tim
;; A. Guravage. Tim doesn't appear to be on the 'net any longer so I ;; left the net for a while and in the interim, Barry Warsaw has
;; (Barry) have undertaken maintenance of the mode. ;; undertaken maintenance of the mode.
;; At some point this mode will undergo a rewrite to bring it more in ;; 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 ;; line with GNU Emacs Lisp coding standards, and to wax all the Emacs
;; mode works exceedingly well, and I've simply been tweaking it as I ;; 18 support. But all in all, the mode works exceedingly well, and
;; go along. Ain't it wonderful that Python has a much more sane ;; I've simply been tweaking it as I go along. Ain't it wonderful
;; syntax than C? (or <shudder> C++?! :-). I can say that; I maintain ;; that Python has a much more sane syntax than C? (or <shudder> C++?!
;; cc-mode! ;; :-). I can say that; I maintain cc-mode!
;; The following statements, placed in your .emacs file or ;; The following statements, placed in your .emacs file or
;; site-init.el, will cause this file to be autoloaded, and ;; 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" ...@@ -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))))) (if py-beep-if-tab-change (beep)))))
(goto-char start)) (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 ;; run the mode hook. py-mode-hook use is deprecated
(if python-mode-hook (if python-mode-hook
(run-hooks 'python-mode-hook) (run-hooks 'python-mode-hook)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment