diff options
| author | Tom Tromey <tromey@redhat.com> | 2013-01-16 11:48:32 -0700 |
|---|---|---|
| committer | Tom Tromey <tromey@redhat.com> | 2013-01-16 11:48:32 -0700 |
| commit | 6f4de085f065e11f4df3195d47479f28f5ef08ba (patch) | |
| tree | 1211a00f1afc86c2b73624897993db02a4852943 /lisp/progmodes/python.el | |
| parent | e078a23febca14bc919c5806670479c395e3253e (diff) | |
| parent | ffe04adc88e546c406f9b050238fb98a7243c7a0 (diff) | |
| download | emacs-6f4de085f065e11f4df3195d47479f28f5ef08ba.tar.gz | |
merge from trunk
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 172193266ca..0e5f4c82090 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1198,7 +1198,16 @@ of the statement." (not (eobp)) (cond ((setq string-start (python-syntax-context 'string)) (goto-char string-start) - (python-nav-end-of-statement t)) + (if (python-syntax-context 'paren) + ;; Ended up inside a paren, roll again. + (python-nav-end-of-statement t) + ;; This is not inside a paren, move to the + ;; end of this string. + (goto-char (+ (point) + (python-syntax-count-quotes + (char-after (point)) (point)))) + (or (re-search-forward (rx (syntax string-delimiter)) nil t) + (goto-char (point-max))))) ((python-syntax-context 'paren) ;; The statement won't end before we've escaped ;; at least one level of parenthesis. @@ -1312,7 +1321,7 @@ backward to previous block." "Safe version of standard `forward-sexp'. When ARG > 0 move forward, else if ARG is < 0." (or arg (setq arg 1)) - (let ((forward-sexp-function nil) + (let ((forward-sexp-function) (paren-regexp (if (> arg 0) (python-rx close-paren) (python-rx open-paren))) (search-fn |
