From: Fabián Ezequiel Gallina Date: Thu, 17 May 2012 03:03:18 +0000 (-0300) Subject: Indentation enhancements on after-backslash X-Git-Tag: emacs-24.2.90~1199^2~559 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9787f82961e029a8a096aa2a4a327eebb974b13c;p=emacs.git Indentation enhancements on after-backslash Multiline sentences beginning with "import", "from" or "return" are indented correctly now. --- diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 4589a828ebe..20176944ebc 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -681,14 +681,15 @@ START is the buffer position where the sexp starts." (current-column)) (t (goto-char context-start) - (if (not (member - (save-excursion - (back-to-indentation) - (message (current-word))) - '("return" "import" "from"))) + (if (not + (save-excursion + (back-to-indentation) + (looking-at + "\\(?:return\\|from\\|import\\)\s+"))) (current-indentation) (+ (current-indentation) - python-indent-offset)))))) + (length + (match-string-no-properties 0)))))))) indentation)) ('inside-paren (or (save-excursion