aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index a51cff8529e..740dfee5870 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1155,9 +1155,15 @@ the line will be re-indented automatically if needed."
1155 ((and (eq ?: last-command-event) 1155 ((and (eq ?: last-command-event)
1156 (memq ?: electric-indent-chars) 1156 (memq ?: electric-indent-chars)
1157 (not current-prefix-arg) 1157 (not current-prefix-arg)
1158 ;; Trigger electric colon only at end of line
1158 (eolp) 1159 (eolp)
1160 ;; Avoid re-indenting on extra colon
1159 (not (equal ?: (char-before (1- (point))))) 1161 (not (equal ?: (char-before (1- (point)))))
1160 (not (python-syntax-comment-or-string-p))) 1162 (not (python-syntax-comment-or-string-p))
1163 ;; Never re-indent at beginning of defun
1164 (not (save-excursion
1165 (python-nav-beginning-of-statement)
1166 (python-info-looking-at-beginning-of-defun))))
1161 (python-indent-line))))) 1167 (python-indent-line)))))
1162 1168
1163 1169