summaryrefslogtreecommitdiff
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina <fgallina@cuca>2012-05-17 00:02:54 -0300
committerFabián Ezequiel Gallina <fgallina@gnu.org>2012-05-17 00:02:54 -0300
commit13d1a42edb24bec24ff85f85f3fce686cd476e72 (patch)
treead3fbe5aea2634d410efc3180517532ed4264b86 /lisp/progmodes/python.el
parentbbac1eb8aba7459dc90e1f8bb21e603d16779077 (diff)
Fixed indentation inside parens when comments are around
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el7
1 files changed, 6 insertions, 1 deletions
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)))