summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1997-11-26 06:14:40 (GMT)
committerBarry Warsaw <barry@python.org>1997-11-26 06:14:40 (GMT)
commitc8520351af85ddee4028abd4ae37f9cae7e1b660 (patch)
tree734d75779e23d2443e02175cd86fc1ab7b50519c
parent4da6bd51dddfb4cfef2853756c4d9ab14c0897f1 (diff)
downloadcpython-c8520351af85ddee4028abd4ae37f9cae7e1b660.zip
cpython-c8520351af85ddee4028abd4ae37f9cae7e1b660.tar.gz
cpython-c8520351af85ddee4028abd4ae37f9cae7e1b660.tar.bz2
(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>
-rw-r--r--Misc/python-mode.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index 624af01..ebecc3c 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -726,8 +726,8 @@ of the first definition found."
(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 @@ of the first definition found."
;; 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 @@ py-beep-if-tab-change\t\tring the bell if tab-width is changed"
(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