diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 6a258892f16..cfa71fc3a74 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -293,8 +293,15 @@ | |||
| 293 | (autoload 'comint-mode "comint") | 293 | (autoload 'comint-mode "comint") |
| 294 | (autoload 'help-function-arglist "help-fns") | 294 | (autoload 'help-function-arglist "help-fns") |
| 295 | 295 | ||
| 296 | (defconst python--auto-mode-alist-regexp | ||
| 297 | (rx "." (or "py" | ||
| 298 | "pth" ; Python Path Configuration File | ||
| 299 | "pyi" ; Python Stub File (PEP 484) | ||
| 300 | "pyw") ; MS-Windows specific extension | ||
| 301 | eos)) | ||
| 302 | |||
| 296 | ;;;###autoload | 303 | ;;;###autoload |
| 297 | (add-to-list 'auto-mode-alist (cons (purecopy "\\.py[iw]?\\'") 'python-mode)) | 304 | (add-to-list 'auto-mode-alist (cons python--auto-mode-alist-regexp 'python-mode)) |
| 298 | ;;;###autoload | 305 | ;;;###autoload |
| 299 | (add-to-list 'interpreter-mode-alist (cons (purecopy "python[0-9.]*") 'python-mode)) | 306 | (add-to-list 'interpreter-mode-alist (cons (purecopy "python[0-9.]*") 'python-mode)) |
| 300 | 307 | ||
| @@ -7208,7 +7215,7 @@ implementations: `python-mode' and `python-ts-mode'." | |||
| 7208 | (when python-indent-guess-indent-offset | 7215 | (when python-indent-guess-indent-offset |
| 7209 | (python-indent-guess-indent-offset)) | 7216 | (python-indent-guess-indent-offset)) |
| 7210 | 7217 | ||
| 7211 | (add-to-list 'auto-mode-alist '("\\.py[iw]?\\'" . python-ts-mode)) | 7218 | (add-to-list 'auto-mode-alist '(python--auto-mode-alist-regexp . python-ts-mode)) |
| 7212 | (add-to-list 'interpreter-mode-alist '("python[0-9.]*" . python-ts-mode)))) | 7219 | (add-to-list 'interpreter-mode-alist '("python[0-9.]*" . python-ts-mode)))) |
| 7213 | 7220 | ||
| 7214 | (derived-mode-add-parents 'python-ts-mode '(python-mode)) | 7221 | (derived-mode-add-parents 'python-ts-mode '(python-mode)) |