]> git.eshelyaron.com Git - emacs.git/commitdiff
(python-end-of-block): Revert last change.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 9 May 2007 16:53:13 +0000 (16:53 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 9 May 2007 16:53:13 +0000 (16:53 +0000)
(python-end-of-statement): Make sure we move *forward*.

lisp/progmodes/python.el

index 17d30e0d9729704f130b8e49385111d02a3bc64c..f45b144779ccd841f992e5931c2a468944eb4be2 100644 (file)
@@ -883,10 +883,13 @@ On a comment line, go to end of line."
                           nil)
                          ((eq 'string (syntax-ppss-context s))
                           ;; Go to start of string and skip it.
-                          (goto-char (nth 8 s))
-                          (condition-case () ; beware invalid syntax
-                              (progn (forward-sexp) t)
-                            (error (end-of-line))))
+                           (let ((pos (point)))
+                             (goto-char (nth 8 s))
+                             (condition-case () ; beware invalid syntax
+                                 (progn (forward-sexp) t)
+                               ;; If there's a mismatched string, make sure
+                               ;; we still overall move *forward*.
+                               (error (goto-char pos) (end-of-line)))))
                          ((python-skip-out t s))))
             (end-of-line))
           (unless comment
@@ -981,15 +984,11 @@ don't move and return nil.  Otherwise return t."
                       (_ (if (python-comment-line-p)
                              (python-skip-comments/blanks t)))
                       (ci (current-indentation))
-                      (open (python-open-block-statement-p))
-                      opoint)
+                      (open (python-open-block-statement-p)))
                  (if (and (zerop ci) (not open))
                      (not (goto-char point))
                    (catch 'done
-                     (setq opoint (point))
-                     (while (and (zerop (python-next-statement))
-                                 (not (= opoint (point))))
-                       (setq opoint (point))
+                      (while (zerop (python-next-statement))
                        (when (or (and open (<= (current-indentation) ci))
                                  (< (current-indentation) ci))
                          (python-skip-comments/blanks t)