Subject: [PATCH] Move configuration of auto-mode-alist out of js-ts-mode
From: Damien Cassou <[email-masked]>
To: [email-masked]
Date: Fri, 12 Jul 2024 09:58:45 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

Hi,

The current version of the code requires the `js-ts-mode' function to
have already been executed for `auto-mode-alist' to contain an entry for
".jsx" files. The patch makes sure that `auto-mode-alist' is updates
when js.el is loaded.

Best

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
From 7fc9bb52a9f51a8caf4d5d016dc8a8812dd5c6a3 Mon Sep 17 00:00:00 2001
From: Damien Cassou <[email-masked]>
Date: Fri, 12 Jul 2024 09:50:45 +0200
Subject: [PATCH] Move configuration of auto-mode-alist out of js-ts-mode

* lisp/progmodes/js.el (js-ts-mode): Remove configuration of
auto-mode-alist.
---
 lisp/progmodes/js.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index f8140c14a49..c3e6077a352 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3957,10 +3957,10 @@ js-ts-mode
                                         "method_definition")
                                 eos)
                    nil nil)))
-    (treesit-major-mode-setup)
+    (treesit-major-mode-setup)))
 
-    (add-to-list 'auto-mode-alist
-                 '("\\(\\.js[mx]\\|\\.har\\)\\'" . js-ts-mode))))
+(add-to-list 'auto-mode-alist
+             '("\\(\\.js[mx]\\|\\.har\\)\\'" . js-ts-mode))
 
 (derived-mode-add-parents 'js-ts-mode '(js-mode))
 
-- 
2.45.2