From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Cassou Newsgroups: gmane.emacs.bugs Subject: bug#72069: [PATCH] Move configuration of auto-mode-alist out of js-ts-mode Date: Mon, 29 Jul 2024 20:20:12 +0200 Message-ID: <87a5i0oyar.fsf@cassou.me> References: <87ed7zca8a.fsf@cassou.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12085"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , 72069@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 29 20:21:30 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 1sYUzx-0002y2-Sk for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Jul 2024 20:21:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYUza-0004R3-1S; Mon, 29 Jul 2024 14:21:06 -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 1sYUzJ-0004Ji-SF for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 14:20:50 -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 1sYUzI-0006gh-Tm for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 14:20:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=QwEl3zdvbF6mB1E1HVG7/Kc7+CONz5OhLZoTQVRP7+M=; b=OtWLUrUEN0yuW5QmDzp9sjnfwsxXz8X9cNODgep+9NJHWydW9BRWgmuBKOCljdlJ5LeQewqKP8PE/Np6j/zP6aUtIvafHQZ0pNTxEVPaZumTpOWR1LrSmrbDVcOnGo5cTfaWBT0rL9iJFsD3Dpi+4SAZhoFTTaQUApWC6FYvjFqkTVeQlr9kJGBFFUMMAFetY7qG0ou7Mo2g15VVVnn8HirX4ikIUIy0HCSVr4EHDiQGPBltfwFRIfVwz9lS1oaMzt8odRWo174QYSTDatEDZQo+tixQZHT1IufErIDyDoqJZoY5kDjE/Tgso8Ko+UtUSx4bBmxHbVe5hdLUQ1rdZA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sYUzV-00034r-Uk for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 14:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Damien Cassou Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Jul 2024 18:21:01 +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.172227723311784 (code B ref 72069); Mon, 29 Jul 2024 18:21:01 +0000 Original-Received: (at 72069) by debbugs.gnu.org; 29 Jul 2024 18:20:33 +0000 Original-Received: from localhost ([127.0.0.1]:46319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYUz2-00033z-Jg for submit@debbugs.gnu.org; Mon, 29 Jul 2024 14:20:32 -0400 Original-Received: from mail.reprendre.net ([193.23.30.35]:43800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYUz0-00033q-0b for 72069@debbugs.gnu.org; Mon, 29 Jul 2024 14:20:31 -0400 Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E58E42C0B56; Mon, 29 Jul 2024 20:20:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cassou.me; s=dkim; t=1722277214; h=from:subject:date:message-id:to:cc:mime-version:content-type: in-reply-to:references; bh=QwEl3zdvbF6mB1E1HVG7/Kc7+CONz5OhLZoTQVRP7+M=; b=jAQ26U84Wz25HI3dyyz6kYYAfDIQKNy1mLRqNuqVWDxZgNMSmGGlF6wwj5yT/GcHoLetOd yGMzbNGtRNEf+qayT2UCB7uybnyar2e4pOXTuJbLc63o1ZnXw4DWcYiXWofScalMiNa4rZ R4Rq+DXiJ81qhiEnV3/AASNDcxgFjRLa0eKqUbJ7ZMphnwbeQl+EQgYgpn+F6JnzCy94SJ iEmLanZgho+3aBkNPcdbyb9EQw0Ddjl/85fS+Ot/DR8/dlah7q+MjzvSyNIUfqaTYyiKQl f5L1pKYuVePwWWI7Y7YuJQy8TdkSAI7BMHEEMYp9IRWxleQLLSx+1aN+LN7HUA== In-Reply-To: X-Last-TLS-Session-Version: TLSv1.3 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:289528 Archived-At: Hi Stefan, thank you very much for your review. Stefan Kangas writes: > Damien Cassou writes: > What about js-mode? Shouldn't that be used out-of-the-box for these files? Definitely, I don't know what I was thinking. I'm not sure there is anything to save on this patch. If you believe I should wrap the call to `add-to-list' within a `(if (treesit-ready-p js) ...)' block I will do that but I don't think this is how things are done for other kinds of files. Otherwise, feel free to close this ticket and please forgive me. Best >>>>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)) -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill