diff options
| author | Kenichi Handa | 2011-11-11 16:08:47 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2011-11-11 16:08:47 +0900 |
| commit | 0756b0c3a6e60dd623da6f12bc8d2de05ef7b8f1 (patch) | |
| tree | 0846cacac3ba56cb8d2054fbc851fee2fb9606d2 /lisp/progmodes/python.el | |
| parent | 9ac0394b8d1e54bf1b49291c85770af36a94531e (diff) | |
| parent | 68cbc58be59373e805fa200db02e4022e20050f0 (diff) | |
| download | emacs-0756b0c3a6e60dd623da6f12bc8d2de05ef7b8f1.tar.gz emacs-0756b0c3a6e60dd623da6f12bc8d2de05ef7b8f1.zip | |
merge trunk
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 21 |
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. |
| 949 | Accounts for continuation lines, multi-line strings, and | 949 | Accounts for continuation lines, multi-line strings, and |
| 950 | multi-line bracketed expressions." | 950 | multi-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." | |||
| 971 | Skip forward if FORWARD is non-nil, else backward. | 961 | Skip forward if FORWARD is non-nil, else backward. |
| 972 | If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point. | 962 | If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point. |
| 973 | Return non-nil if and only if skipping was done." | 963 | Return 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) |