From 9787f82961e029a8a096aa2a4a327eebb974b13c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabi=C3=A1n=20Ezequiel=20Gallina?= Date: Thu, 17 May 2012 00:03:18 -0300 Subject: [PATCH] Indentation enhancements on after-backslash Multiline sentences beginning with "import", "from" or "return" are indented correctly now. --- lisp/progmodes/python.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 -- 2.39.5