diff options
| author | Stefan Monnier | 2007-05-09 16:53:13 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-05-09 16:53:13 +0000 |
| commit | 0f21ecf3c59d4ad711f27384d144c7da834ff20a (patch) | |
| tree | 4e5a842ac42f38c73038ae2c019dbf99a31bfbba /lisp/progmodes/python.el | |
| parent | 44a07c5a3c7b037fa066f77b27400bdb506e8df7 (diff) | |
| download | emacs-0f21ecf3c59d4ad711f27384d144c7da834ff20a.tar.gz emacs-0f21ecf3c59d4ad711f27384d144c7da834ff20a.zip | |
(python-end-of-block): Revert last change.
(python-end-of-statement): Make sure we move *forward*.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 17d30e0d972..f45b144779c 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -883,10 +883,13 @@ On a comment line, go to end of line." | |||
| 883 | nil) | 883 | nil) |
| 884 | ((eq 'string (syntax-ppss-context s)) | 884 | ((eq 'string (syntax-ppss-context s)) |
| 885 | ;; Go to start of string and skip it. | 885 | ;; Go to start of string and skip it. |
| 886 | (goto-char (nth 8 s)) | 886 | (let ((pos (point))) |
| 887 | (condition-case () ; beware invalid syntax | 887 | (goto-char (nth 8 s)) |
| 888 | (progn (forward-sexp) t) | 888 | (condition-case () ; beware invalid syntax |
| 889 | (error (end-of-line)))) | 889 | (progn (forward-sexp) t) |
| 890 | ;; If there's a mismatched string, make sure | ||
| 891 | ;; we still overall move *forward*. | ||
| 892 | (error (goto-char pos) (end-of-line))))) | ||
| 890 | ((python-skip-out t s)))) | 893 | ((python-skip-out t s)))) |
| 891 | (end-of-line)) | 894 | (end-of-line)) |
| 892 | (unless comment | 895 | (unless comment |
| @@ -981,15 +984,11 @@ don't move and return nil. Otherwise return t." | |||
| 981 | (_ (if (python-comment-line-p) | 984 | (_ (if (python-comment-line-p) |
| 982 | (python-skip-comments/blanks t))) | 985 | (python-skip-comments/blanks t))) |
| 983 | (ci (current-indentation)) | 986 | (ci (current-indentation)) |
| 984 | (open (python-open-block-statement-p)) | 987 | (open (python-open-block-statement-p))) |
| 985 | opoint) | ||
| 986 | (if (and (zerop ci) (not open)) | 988 | (if (and (zerop ci) (not open)) |
| 987 | (not (goto-char point)) | 989 | (not (goto-char point)) |
| 988 | (catch 'done | 990 | (catch 'done |
| 989 | (setq opoint (point)) | 991 | (while (zerop (python-next-statement)) |
| 990 | (while (and (zerop (python-next-statement)) | ||
| 991 | (not (= opoint (point)))) | ||
| 992 | (setq opoint (point)) | ||
| 993 | (when (or (and open (<= (current-indentation) ci)) | 992 | (when (or (and open (<= (current-indentation) ci)) |
| 994 | (< (current-indentation) ci)) | 993 | (< (current-indentation) ci)) |
| 995 | (python-skip-comments/blanks t) | 994 | (python-skip-comments/blanks t) |