]> git.eshelyaron.com Git - emacs.git/commitdiff
bug#78901: [PATCH] js-ts-mode: Fix auto-mode-alist regexp
authorLiam Hupfer <liam@hpfr.net>
Thu, 26 Jun 2025 03:47:34 +0000 (22:47 -0500)
committerEshel Yaron <me@eshelyaron.com>
Wed, 23 Jul 2025 20:07:51 +0000 (22:07 +0200)
Align the js-ts-mode entry with the javascript-mode entries in the
default auto-mode-alist value in lisp/files.el. Otherwise, js-ts-mode is
not associated with .js files.

* lisp/progmodes/js.el (js-ts-mode): Fix auto-mode-alist regexp.

Fixes: 2023-01-20 6b2f85caa6ca "Make tree-sitter based modes optional"
(cherry picked from commit 6299eb0fe54c87bcbb0f6ab4de3e4f9e250d4586)

lisp/progmodes/js.el

index ec7c2602d331f665ae3b29c2b766da50a3d1a477..d96e3ada49a81202a56fe267c2ed2be9031cc126 100644 (file)
@@ -4103,7 +4103,7 @@ See `treesit-thing-settings' for more information.")
     (treesit-major-mode-setup)
 
     (add-to-list 'auto-mode-alist
-                 '("\\(\\.js[mx]\\|\\.har\\)\\'" . js-ts-mode))))
+                 '("\\(\\.js[mx]?\\|\\.har\\)\\'" . js-ts-mode))))
 
 (derived-mode-add-parents 'js-ts-mode '(js-mode))