From 13d1a42edb24bec24ff85f85f3fce686cd476e72 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabi=C3=A1n=20Ezequiel=20Gallina?= Date: Thu, 17 May 2012 00:02:54 -0300 Subject: [PATCH] Fixed indentation inside parens when comments are around --- lisp/progmodes/python.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index e4019373362..3cdfb43e35f 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -568,7 +568,12 @@ START is the buffer position where the sexp starts." (save-excursion (goto-char context-start) (forward-char) - (if (looking-at "[[:space:]]*$") + (save-restriction + (narrow-to-region + (line-beginning-position) + (line-end-position)) + (forward-comment 1)) + (if (looking-at "$") (+ (current-indentation) python-indent-offset) (forward-comment 1) (current-column))) -- 2.39.2