diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 56c80c8264b..7576bae9f95 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -7090,6 +7090,11 @@ implementations: `python-mode' and `python-ts-mode'." | |||
| 7090 | `((?: . ,(lambda () | 7090 | `((?: . ,(lambda () |
| 7091 | (and (zerop (car (syntax-ppss))) | 7091 | (and (zerop (car (syntax-ppss))) |
| 7092 | (python-info-statement-starts-block-p) | 7092 | (python-info-statement-starts-block-p) |
| 7093 | ;; Heuristic: assume walrus operator := | ||
| 7094 | ;; when colon is preceded by space. | ||
| 7095 | (save-excursion | ||
| 7096 | (goto-char (- (point) 2)) | ||
| 7097 | (looking-at (rx (not space) ":"))) | ||
| 7093 | 'after))))) | 7098 | 'after))))) |
| 7094 | 7099 | ||
| 7095 | ;; Add """ ... """ pairing to electric-pair-mode. | 7100 | ;; Add """ ... """ pairing to electric-pair-mode. |