[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r111167: * progmodes/python.el (py
From: |
Fabián Ezequiel Gallina |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r111167: * progmodes/python.el (python-nav-end-of-statement): Fix |
Date: |
Thu, 10 Jan 2013 00:44:12 -0300 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 111167
committer: Fabián Ezequiel Gallina <address@hidden>
branch nick: emacs-24
timestamp: Thu 2013-01-10 00:44:12 -0300
message:
* progmodes/python.el (python-nav-end-of-statement): Fix
cornercase when handling multiline strings.
modified:
lisp/ChangeLog
lisp/progmodes/python.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-01-10 02:30:06 +0000
+++ b/lisp/ChangeLog 2013-01-10 03:44:12 +0000
@@ -1,3 +1,8 @@
+2013-01-10 Fabián Ezequiel Gallina <address@hidden>
+
+ * progmodes/python.el (python-nav-end-of-statement): Fix
+ cornercase when handling multiline strings.
+
2013-01-10 Glenn Morris <address@hidden>
* emacs-lisp/authors.el (authors-ignored-files)
=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el 2013-01-01 09:11:05 +0000
+++ b/lisp/progmodes/python.el 2013-01-10 03:44:12 +0000
@@ -1188,7 +1188,16 @@
(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.
@@ -1302,7 +1311,7 @@
"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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-24 r111167: * progmodes/python.el (python-nav-end-of-statement): Fix,
Fabián Ezequiel Gallina <=