GNU bug report logs - #78901
[PATCH] js-ts-mode: Fix auto-mode-alist regexp

Previous Next

Package: emacs;

Reported by: Liam Hupfer <liam <at> hpfr.net>

Date: Thu, 26 Jun 2025 03:49:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 78901 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#78901; Package emacs. (Thu, 26 Jun 2025 03:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Liam Hupfer <liam <at> hpfr.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 26 Jun 2025 03:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Liam Hupfer <liam <at> hpfr.net>
To: bug-gnu-emacs <at> gnu.org
Cc: Liam Hupfer <liam <at> hpfr.net>
Subject: [PATCH] js-ts-mode: Fix auto-mode-alist regexp
Date: Wed, 25 Jun 2025 22:47:34 -0500
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"
---
 lisp/progmodes/js.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 4c93d9ce22b..bed2ef0616a 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -4108,7 +4108,7 @@ js-ts-mode
     (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))
 

base-commit: faae9f572ab3027c46800575a12a72c8c0eee7c1
-- 
2.49.0





This bug report was last modified 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.