aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el21
1 files changed, 6 insertions, 15 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 38bf9552b2a..8615400bf6a 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -948,22 +948,12 @@ Finds end of innermost nested class or method definition."
948 "Go to start of current statement. 948 "Go to start of current statement.
949Accounts for continuation lines, multi-line strings, and 949Accounts for continuation lines, multi-line strings, and
950multi-line bracketed expressions." 950multi-line bracketed expressions."
951 (beginning-of-line) 951 (while
952 (python-beginning-of-string)
953 (let (point)
954 (while (and (python-continuation-line-p)
955 (if point
956 (< (point) point)
957 t))
958 (beginning-of-line)
959 (if (python-backslash-continuation-line-p) 952 (if (python-backslash-continuation-line-p)
960 (progn 953 (progn (forward-line -1) t)
961 (forward-line -1) 954 (beginning-of-line)
962 (while (python-backslash-continuation-line-p) 955 (or (python-beginning-of-string)
963 (forward-line -1))) 956 (python-skip-out))))
964 (python-beginning-of-string)
965 (python-skip-out))
966 (setq point (point))))
967 (back-to-indentation)) 957 (back-to-indentation))
968 958
969(defun python-skip-out (&optional forward syntax) 959(defun python-skip-out (&optional forward syntax)
@@ -971,6 +961,7 @@ multi-line bracketed expressions."
971Skip forward if FORWARD is non-nil, else backward. 961Skip forward if FORWARD is non-nil, else backward.
972If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point. 962If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point.
973Return non-nil if and only if skipping was done." 963Return non-nil if and only if skipping was done."
964 ;; FIXME: Use syntax-ppss-toplevel-pos.
974 (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss)))) 965 (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss))))
975 (forward (if forward -1 1))) 966 (forward (if forward -1 1)))
976 (unless (zerop depth) 967 (unless (zerop depth)