Mercurial > emacs
comparison lisp/progmodes/python.el @ 94590:b4b1e6b43d64
Dave Love <fx at gnu.org>
(python-beginning-of-statement): Loop at least once (fixes 2008-02-21 change).
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 03 May 2008 18:51:19 +0000 |
parents | 1e40bf35d15e |
children | a088027cd6c2 |
comparison
equal
deleted
inserted
replaced
94589:d97320b13374 | 94590:b4b1e6b43d64 |
---|---|
975 "Go to start of current statement. | 975 "Go to start of current statement. |
976 Accounts for continuation lines, multi-line strings, and | 976 Accounts for continuation lines, multi-line strings, and |
977 multi-line bracketed expressions." | 977 multi-line bracketed expressions." |
978 (beginning-of-line) | 978 (beginning-of-line) |
979 (python-beginning-of-string) | 979 (python-beginning-of-string) |
980 (let ((point (point))) | 980 (let (point) |
981 (while (and (python-continuation-line-p) | 981 (while (and (python-continuation-line-p) |
982 (> point (setq point (point)))) | 982 (if point |
983 (< (point) point) | |
984 t)) | |
983 (beginning-of-line) | 985 (beginning-of-line) |
984 (if (python-backslash-continuation-line-p) | 986 (if (python-backslash-continuation-line-p) |
985 (progn | 987 (progn |
986 (forward-line -1) | 988 (forward-line -1) |
987 (while (python-backslash-continuation-line-p) | 989 (while (python-backslash-continuation-line-p) |
988 (forward-line -1))) | 990 (forward-line -1))) |
989 (python-beginning-of-string) | 991 (python-beginning-of-string) |
990 (python-skip-out)))) | 992 (python-skip-out)) |
993 (setq point (point)))) | |
991 (back-to-indentation)) | 994 (back-to-indentation)) |
992 | 995 |
993 (defun python-skip-out (&optional forward syntax) | 996 (defun python-skip-out (&optional forward syntax) |
994 "Skip out of any nested brackets. | 997 "Skip out of any nested brackets. |
995 Skip forward if FORWARD is non-nil, else backward. | 998 Skip forward if FORWARD is non-nil, else backward. |