]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/python.el
python.el removed.
[gnu-emacs] / lisp / progmodes / python.el
index 1709428a61106f54ec95127a365e33b1dca33761..e57c7e639c9fa50de3fc844e5873c302552bf5d5 100644 (file)
@@ -981,11 +981,15 @@ don't move and return nil.  Otherwise return t."
                       (_ (if (python-comment-line-p)
                              (python-skip-comments/blanks t)))
                       (ci (current-indentation))
-                      (open (python-open-block-statement-p)))
+                      (open (python-open-block-statement-p))
+                      opoint)
                  (if (and (zerop ci) (not open))
                      (not (goto-char point))
                    (catch 'done
-                     (while (zerop (python-next-statement))
+                     (setq opoint (point))
+                     (while (and (zerop (python-next-statement))
+                                 (not (= opoint (point))))
+                       (setq opoint (point))
                        (when (or (and open (<= (current-indentation) ci))
                                  (< (current-indentation) ci))
                          (python-skip-comments/blanks t)