Mercurial > emacs
diff lisp/progmodes/python.el @ 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 | e359709ed895 |
| children | ca9519bf5703 e6fdae9180d4 |
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)
