]> git.eshelyaron.com Git - emacs.git/commitdiff
python.el: Use correct regexp when enabling python-ts-mode
authorBrian Leung <leungbk@posteo.net>
Fri, 27 Jan 2023 01:36:42 +0000 (17:36 -0800)
committerEli Zaretskii <eliz@gnu.org>
Sat, 28 Jan 2023 11:26:53 +0000 (13:26 +0200)
* lisp/progmodes/python.el: Use "python[0-9.]*" regexp for
'interpreter-mode-alist', and not 'auto-mode-alist'.  (Bug#61090)

lisp/progmodes/python.el

index a869cdc5fdbbd7a6a621d537c96ca603a062504e..df0d1c96965dd27ea646a19f1c11da8974743ecc 100644 (file)
@@ -6715,8 +6715,8 @@ implementations: `python-mode' and `python-ts-mode'."
     (when python-indent-guess-indent-offset
       (python-indent-guess-indent-offset))
 
-    (add-to-list 'auto-mode-alist
-                 '("\\.py[iw]?\\'\\|python[0-9.]*" . python-ts-mode))))
+    (add-to-list 'auto-mode-alist '("\\.py[iw]?\\'" . python-ts-mode))
+    (add-to-list 'interpreter-mode-alist '("python[0-9.]*" . python-ts-mode))))
 
 ;;; Completion predicates for M-x
 ;; Commands that only make sense when editing Python code