summaryrefslogtreecommitdiff
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2004-07-02 23:49:50 +0000
committerRichard M. Stallman <rms@gnu.org>2004-07-02 23:49:50 +0000
commitb830b63b85d766d77daa5e4f835141cbf3d81980 (patch)
tree8204168013e7220d82bd6f0d3e9fc0a935307fa9 /lisp/progmodes/python.el
parent30f0bc330f0470ba6b03f3f5c7913c081dc7e74e (diff)
downloademacs-b830b63b85d766d77daa5e4f835141cbf3d81980.tar.gz
(python-beginning-of-statement): Exit the loop if backward-up-list gets error.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el21
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 274480a36de..9be2c7599b8 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -710,16 +710,17 @@ Accounts for continuation lines, multi-line strings, and multi-line bracketed
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 ()