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 f12486d0acb..dc38966bcaf 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1162,9 +1162,15 @@ the line will be re-indented automatically if needed."
1162 ((and (eq ?: last-command-event) 1162 ((and (eq ?: last-command-event)
1163 (memq ?: electric-indent-chars) 1163 (memq ?: electric-indent-chars)
1164 (not current-prefix-arg) 1164 (not current-prefix-arg)
1165 ;; Trigger electric colon only at end of line
1165 (eolp) 1166 (eolp)
1167 ;; Avoid re-indenting on extra colon
1166 (not (equal ?: (char-before (1- (point))))) 1168 (not (equal ?: (char-before (1- (point)))))
1167 (not (python-syntax-comment-or-string-p))) 1169 (not (python-syntax-comment-or-string-p))
1170 ;; Never re-indent at beginning of defun
1171 (not (save-excursion
1172 (python-nav-beginning-of-statement)
1173 (python-info-looking-at-beginning-of-defun))))
1168 (python-indent-line))))) 1174 (python-indent-line)))))
1169 1175
1170 1176