From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#72069: [PATCH] Move configuration of auto-mode-alist out of js-ts-mode Date: Wed, 24 Jul 2024 07:05:55 -0700 Message-ID: References: <87ed7zca8a.fsf@cassou.me> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26683"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , 72069@debbugs.gnu.org To: Damien Cassou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 24 16:08:23 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sWcfF-0006l1-L0 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Jul 2024 16:08:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWces-0004c8-D2; Wed, 24 Jul 2024 10:07:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWcer-0004bx-0d for bug-gnu-emacs@gnu.org; Wed, 24 Jul 2024 10:07:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWceq-0008C1-P9 for bug-gnu-emacs@gnu.org; Wed, 24 Jul 2024 10:07:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sWcew-0006QY-ET for bug-gnu-emacs@gnu.org; Wed, 24 Jul 2024 10:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Jul 2024 14:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72069 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72069-submit@debbugs.gnu.org id=B72069.172183003324641 (code B ref 72069); Wed, 24 Jul 2024 14:08:02 +0000 Original-Received: (at 72069) by debbugs.gnu.org; 24 Jul 2024 14:07:13 +0000 Original-Received: from localhost ([127.0.0.1]:34273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWce9-0006PM-0I for submit@debbugs.gnu.org; Wed, 24 Jul 2024 10:07:13 -0400 Original-Received: from mail-lj1-f176.google.com ([209.85.208.176]:45250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWce5-0006P6-MU for 72069@debbugs.gnu.org; Wed, 24 Jul 2024 10:07:11 -0400 Original-Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2f01e9f53ebso25013161fa.2 for <72069@debbugs.gnu.org>; Wed, 24 Jul 2024 07:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721829957; x=1722434757; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=CnhU+rBxVCpEMKFPg4rR1fTzrzx9PvhvjT3ZgPeMMow=; b=aP+8JIspChaPfnfg4DL4tsLJgAx83lW8xxE2GgR3yzMS11ZXq8tqlC2EGXC3zYTOgV odBQPIrFQXViN33T8j9tgn3L5gxV3eqd5usGJ/lUs0lVjBh9dyDAscCN53tuvSP4zchD ktgwCVVYRzr24Iv1R3ZjbcUSIGrOlQY3836K+HJSNlS3VGBxNacktm2lD7sSXGD33LNu 68/Aw6Dkm+nAzvveQ5iQ5zGl1DwQQtWKQN56w8tsCgL5LX/v6qt6Z8OOekcCsAQAIuDJ 5/N4awetRX58EET5A3uFLP1k5PkI1HzvXJvHv3tgFkf49G6eFhvDKskKgCTbktco0LWi K3bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721829957; x=1722434757; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CnhU+rBxVCpEMKFPg4rR1fTzrzx9PvhvjT3ZgPeMMow=; b=B+1L6+819FHmxvHS5W5JEKxg5oq0Ne7akrtlXy5oMx7w4oEM7NKiA/Z+VSVCfoJ5EH /axYm5ZvBBALHDTyauWal2LDjbaYLY6eWitAjmdZbs+NdcmPpRTuz9v4YuywUHAqV9AX D4B2XL6cYQv+SRFtOreeCf9K7uctQ5pkQ+n6XU5BHRemH6RbWmkId76fW/dTu77fuzXd BNym9+JEquW3JZBk0rr0uK8Jhm1mmzYE6zWTdMZLoL3WAmxhDDn+Qu+dfwSbfJMAQqnY QRTW8R+oUf848PvRv/1IlOpPpdpkk4XyqD713xLxKhSe1SYuVuTCCMoDeo2QfLHPIjwm jOvw== X-Gm-Message-State: AOJu0YzfC5cSIMaMekmp1L/rCREuMrJHY/ds3nyQ6/hGTSO9zMm9zuyS z8kmw3eg7NMvBQ0gLEkU5QN/kou2modcK5Sgdu1DTQAfts7uYBCyhT/J8kJv21+SKmc2Ak7z/FB HiEjCHTtQ1GGAgqriczOh8zMGh0w= X-Google-Smtp-Source: AGHT+IGHKk7axM6kfuEQWt7qe/huLnmBF81PiaZv34r2mUcr8O7RRbizf367tUxnn1MJDIt1rrHR5lHgEH8KKLHU/eg= X-Received: by 2002:a2e:9d92:0:b0:2ee:7a54:3b08 with SMTP id 38308e7fff4ca-2f0324dd6e7mr17060361fa.3.1721829956919; Wed, 24 Jul 2024 07:05:56 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 24 Jul 2024 07:05:55 -0700 In-Reply-To: <87ed7zca8a.fsf@cassou.me> (Damien Cassou's message of "Fri, 12 Jul 2024 09:58:45 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289227 Archived-At: Damien Cassou writes: > 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. Thanks for the patch. What about js-mode? Shouldn't that be used out-of-the-box for these files? >>>From 7fc9bb52a9f51a8caf4d5d016dc8a8812dd5c6a3 Mon Sep 17 00:00:00 2001 > From: Damien Cassou > 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)) Shouldn't this be wrapped in (if (treesit-ready-p js) ...) ? > > (derived-mode-add-parents 'js-ts-mode '(js-mode))