From: Fabián Ezequiel Gallina Date: Thu, 17 May 2012 03:03:43 +0000 (-0300) Subject: Enhancements to `python-end-of-defun-function' so it's not blocked by top level assig... X-Git-Tag: emacs-24.2.90~1199^2~487 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0d85f46527ddbe40510181c025a67bd819d208b3;p=emacs.git Enhancements to `python-end-of-defun-function' so it's not blocked by top level assignments (fixes #64) --- diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 3c1e85834de..71c5453ee2d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -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))))