]> git.eshelyaron.com Git - emacs.git/commitdiff
Enhancements to `python-end-of-defun-function' so it's not blocked by top level assig...
authorFabián Ezequiel Gallina <fgallina@cuca>
Thu, 17 May 2012 03:03:43 +0000 (00:03 -0300)
committerFabián Ezequiel Gallina <fgallina@gnu.org>
Thu, 17 May 2012 03:03:43 +0000 (00:03 -0300)
lisp/progmodes/python.el

index 3c1e85834def043617dba0bfbbeef070c3c65140..71c5453ee2d491548bd8d060b95dfde1f01f1aa0 100644 (file)
@@ -1080,12 +1080,9 @@ Returns nil if point is not in a def or class."
     (while (and (forward-line 1)
                 (not (eobp))
                 (or (not (current-word))
-                    ;; This checks if the indentation is less than the base
-                    ;; one and if the line is not a comment
-                    (or (> (current-indentation) beg-defun-indent)
-                        (equal
-                         (char-after
-                          (+ (point) (current-indentation))) ?#)))))
+                    (equal (char-after (+ (point) (current-indentation))) ?#)
+                    (> (current-indentation) beg-defun-indent)
+                    (not (looking-at python-nav-beginning-of-defun-regexp)))))
     (python-util-forward-comment)
     (goto-char (line-beginning-position))))