Commit 90132c14 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/progmodes/python.el (python-beginning-of-statement): Rewrite.

Fixes: debbugs:2703
parent d2ad7ee1
2011-11-09 Stefan Monnier <>
* progmodes/python.el (python-beginning-of-statement):
Rewrite (bug#2703).
* progmodes/compile.el: Better handle TABs (bug#9749).
(compilation-next-error-function): Obey the target buffer's
......@@ -948,22 +948,12 @@ Finds end of innermost nested class or method definition."
"Go to start of current statement.
Accounts for continuation lines, multi-line strings, and
multi-line bracketed expressions."
(let (point)
(while (and (python-continuation-line-p)
(if point
(< (point) point)
(if (python-backslash-continuation-line-p)
(forward-line -1)
(while (python-backslash-continuation-line-p)
(forward-line -1)))
(setq point (point))))
(progn (forward-line -1) t)
(or (python-beginning-of-string)
(defun python-skip-out (&optional forward syntax)
......@@ -971,6 +961,7 @@ multi-line bracketed expressions."
Skip forward if FORWARD is non-nil, else backward.
If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point.
Return non-nil if and only if skipping was done."
;; FIXME: Use syntax-ppss-toplevel-pos.
(let ((depth (syntax-ppss-depth (or syntax (syntax-ppss))))
(forward (if forward -1 1)))
(unless (zerop depth)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment