changeset 56324:e6bf7376c962

(python-beginning-of-statement): Exit the loop if backward-up-list gets error.
author Richard M. Stallman <rms@gnu.org>
date Fri, 02 Jul 2004 23:49:50 +0000
parents a712704c769c
children 06c785c5e655
files lisp/progmodes/python.el
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/python.el	Fri Jul 02 23:47:44 2004 +0000
+++ b/lisp/progmodes/python.el	Fri Jul 02 23:49:50 2004 +0000
@@ -710,16 +710,17 @@
 expressions."
   (beginning-of-line)
   (python-beginning-of-string)
-  (while (python-continuation-line-p)
-    (beginning-of-line)
-    (if (python-backslash-continuation-line-p)
-	(while (python-backslash-continuation-line-p)
-	  (forward-line -1))
-      (python-beginning-of-string)
-      ;; Skip forward out of nested brackets.
-      (condition-case ()		; beware invalid syntax
-	  (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t)
-	(error (end-of-line)))))
+  (catch 'foo
+    (while (python-continuation-line-p)
+      (beginning-of-line)
+      (if (python-backslash-continuation-line-p)
+	  (while (python-backslash-continuation-line-p)
+	    (forward-line -1))
+	(python-beginning-of-string)
+	;; Skip forward out of nested brackets.
+	(condition-case ()		; beware invalid syntax
+	    (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t)
+	  (error (throw 'foo nil))))))
   (back-to-indentation))
 
 (defun python-end-of-statement ()