]> granicus.if.org Git - python/commitdiff
(py-imenu-create-index-function): Skip over stuff that looks like code
authorBarry Warsaw <barry@python.org>
Tue, 16 Jul 2002 16:04:13 +0000 (16:04 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 16 Jul 2002 16:04:13 +0000 (16:04 +0000)
but which is in a comment or string.  Closes SF bug # 572341 reported
by Adrian van den Dries.

Misc/python-mode.el

index 5e346043d54becff81973c9b42fda8273139dae7..a5e4fe3b2965a920c5a56f9a1382db4becf89ebb 100644 (file)
@@ -945,6 +945,8 @@ of the first definition found."
       ;; 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))