diff Misc/python-mode.el @ 24248:305422d69d31 legacy-trunk

(py-imenu-create-index-function): Skip over stuff that looks like code but which is in a comment or string. Closes SF bug # 572341 reported by Adrian van den Dries.
author Barry Warsaw <barry@python.org>
date Tue, 16 Jul 2002 16:04:13 +0000
parents 9a58d64f8fc3
children d7237037f379
line wrap: on
line diff
--- a/Misc/python-mode.el	Tue Jul 16 15:56:52 2002 +0000
+++ b/Misc/python-mode.el	Tue Jul 16 16:04:13 2002 +0000
@@ -945,6 +945,8 @@
       ;; what level is the next definition on?  must be same, deeper
       ;; or shallower indentation
       (cond
+       ;; Skip code in comments and strings
+       ((py-in-literal))
        ;; at the same indent level, add it to the list...
        ((= start-indent cur-indent)
 	(push (cons def-name def-pos) index-alist))