changeset 77272:3ae6fc8b3d2c

(python-end-of-block): Avoid looping forever if python-next-statement fails.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 16 Apr 2007 18:55:29 +0000
parents 832f3a05910a
children 175da25b05d8
files lisp/progmodes/python.el
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/python.el	Mon Apr 16 18:55:18 2007 +0000
+++ b/lisp/progmodes/python.el	Mon Apr 16 18:55:29 2007 +0000
@@ -981,11 +981,15 @@
 		       (_ (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)