aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorStefan Kangas2024-09-21 04:41:46 +0200
committerStefan Kangas2024-09-21 14:08:09 +0200
commitdfecd6037d5ebe5778c40ff7b38bfcbaa3ef779e (patch)
treee9b6f41fb0c3a0f034833c10ebc3512d7b387111 /lisp/progmodes/python.el
parent7a404e6d510830323381e5febbe61273f341dc20 (diff)
downloademacs-dfecd6037d5ebe5778c40ff7b38bfcbaa3ef779e.tar.gz
emacs-dfecd6037d5ebe5778c40ff7b38bfcbaa3ef779e.zip
Support electric-layout-mode in python-base-mode
* lisp/progmodes/python.el (python-base-mode): Add support for 'electric-layout-mode'.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index b350b5dadf9..5f85fecf016 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -7071,6 +7071,11 @@ implementations: `python-mode' and `python-ts-mode'."
7071 (setq-local electric-indent-inhibit t) 7071 (setq-local electric-indent-inhibit t)
7072 (setq-local electric-indent-chars 7072 (setq-local electric-indent-chars
7073 (cons ?: electric-indent-chars)) 7073 (cons ?: electric-indent-chars))
7074 (setq-local electric-layout-rules
7075 `((?: . ,(lambda ()
7076 (and (zerop (car (syntax-ppss)))
7077 (python-info-statement-starts-block-p)
7078 'after)))))
7074 7079
7075 ;; Add """ ... """ pairing to electric-pair-mode. 7080 ;; Add """ ... """ pairing to electric-pair-mode.
7076 (add-hook 'post-self-insert-hook 7081 (add-hook 'post-self-insert-hook