From: Barry Warsaw Date: Fri, 16 Dec 1994 00:13:34 +0000 (+0000) Subject: (py-compute-indentation): in `t' clause, watch for the X-Git-Tag: v1.2b1~101 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ff444992ffe9a64a96560af1147560803092069;p=thirdparty%2FPython%2Fcpython.git (py-compute-indentation): in `t' clause, watch for the re-search-backwards landing you inside a mult-line string. --- diff --git a/Misc/python-mode.el b/Misc/python-mode.el index de5a8cb8b579..76b391c5980b 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -596,6 +596,13 @@ the new line indented." ;; happens to be a continuation line too (re-search-backward "^[ \t]*\\([^ \t\n#]\\|#[ \t\n]\\)" nil 'move) + ;; if we landed inside a string, go to the beginning of that string + (let ((state (parse-partial-sexp + (save-excursion (beginning-of-python-def-or-class) + (point)) + (point)))) + (if (nth 3 state) + (goto-char (nth 2 state)))) (py-goto-initial-line) (if (py-statement-opens-block-p) (+ (current-indentation) py-indent-offset)