mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-05 19:31:02 -08:00
Support electric-layout-mode in python-base-mode
* lisp/progmodes/python.el (python-base-mode): Add support for 'electric-layout-mode'.
This commit is contained in:
parent
7a404e6d51
commit
dfecd6037d
1 changed files with 5 additions and 0 deletions
|
|
@ -7071,6 +7071,11 @@ implementations: `python-mode' and `python-ts-mode'."
|
|||
(setq-local electric-indent-inhibit t)
|
||||
(setq-local electric-indent-chars
|
||||
(cons ?: electric-indent-chars))
|
||||
(setq-local electric-layout-rules
|
||||
`((?: . ,(lambda ()
|
||||
(and (zerop (car (syntax-ppss)))
|
||||
(python-info-statement-starts-block-p)
|
||||
'after)))))
|
||||
|
||||
;; Add """ ... """ pairing to electric-pair-mode.
|
||||
(add-hook 'post-self-insert-hook
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue