From: Barry Warsaw Date: Mon, 24 May 1999 18:37:57 +0000 (+0000) Subject: (py-statement-closes-block-p): Add a py-goto-initial-line which fixes X-Git-Tag: v1.6a1~1331 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a8f99ba2d217f94d8129bede137296b08c16c750;p=thirdparty%2FPython%2Fcpython.git (py-statement-closes-block-p): Add a py-goto-initial-line which fixes indentation when the return value is a multiline sexp: def bug(): try: if 2>1: return (11+ 12) else: #XXX return 12 except: return 13 --- diff --git a/Misc/python-mode.el b/Misc/python-mode.el index e139b5148dbb..3e24ba371ceb 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -2923,6 +2923,7 @@ I.e., if the line starts with `return', `raise', `break', `continue', and `pass'. This doesn't catch embedded statements." (let ((here (point))) (back-to-indentation) + (py-goto-initial-line) (prog1 (looking-at (concat py-block-closing-keywords-re "\\>")) (goto-char here))))