Mercurial > cpython-lru_cache-weakref
diff Misc/python-mode.el @ 6670:8e3ee3577d4e legacy-trunk
(python-mode): Make imenu-create-index-function buffer local.
(imenu-example--create-python-index-engine): Use
buffer-substring-no-properties. Also, don't use
imenu-create-submenu-name. Apparently it is obsolete.
These Imenu patches were given by Christian Egli
<christian.egli@stest.ch>
| author | Barry Warsaw <barry@python.org> |
|---|---|
| date | Wed, 26 Nov 1997 06:14:40 +0000 |
| parents | 2f5c8374825c |
| children | e45b83708d9e |
line wrap: on
line diff
--- a/Misc/python-mode.el Wed Nov 26 06:00:26 1997 +0000 +++ b/Misc/python-mode.el Wed Nov 26 06:14:40 1997 +0000 @@ -726,8 +726,8 @@ (let ((cur-paren (if (match-beginning class-paren) class-paren def-paren))) (setq def-name - (buffer-substring (match-beginning cur-paren) - (match-end cur-paren)))) + (buffer-substring-no-properties (match-beginning cur-paren) + (match-end cur-paren)))) (beginning-of-line) (setq cur-indent (current-indentation))) @@ -772,7 +772,7 @@ ;; we put the last element on the index-alist on the start ;; of the submethod alist so the user can still get to it. (let ((save-elmt (pop index-alist))) - (push (cons (imenu-create-submenu-name prev-name) + (push (cons prev-name (cons save-elmt sub-method-alist)) index-alist)))) @@ -875,6 +875,7 @@ (goto-char start)) ;; install imenu + (make-variable-buffer-local 'imenu-create-index-function) (setq imenu-create-index-function (function imenu-example--create-python-index)) (setq imenu-generic-expression
