From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#60559: 29.0.60; "Cannot activate tree-sitter" spam Date: Thu, 05 Jan 2023 08:44:30 +0000 Message-ID: <8dea9f3e0ea979c713da@heytings.org> References: <84973.1672843723@hassadar.pretzelnet.org> <83wn62xi3k.fsf@gnu.org> <83o7rexe2n.fsf@gnu.org> <83h6x5xym7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28959"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Fu Yuan , 60559@debbugs.gnu.org, Theodor Thornhill , mardani29@yahoo.es, Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= , Stefan Monnier , Lars Ingebrigtsen , epg@pretzelnet.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 05 09:45:21 2023 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 1pDLsG-0007Gu-Gv for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Jan 2023 09:45:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDLs0-00006W-ML; Thu, 05 Jan 2023 03:45:04 -0500 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 1pDLry-00006H-Sr for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 03:45:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDLry-0003ny-IF for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 03:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDLry-00035N-Ej for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 03:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jan 2023 08:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60559 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix notabug Original-Received: via spool by 60559-submit@debbugs.gnu.org id=B60559.167290827411803 (code B ref 60559); Thu, 05 Jan 2023 08:45:02 +0000 Original-Received: (at 60559) by debbugs.gnu.org; 5 Jan 2023 08:44:34 +0000 Original-Received: from localhost ([127.0.0.1]:50227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDLrW-00034J-EZ for submit@debbugs.gnu.org; Thu, 05 Jan 2023 03:44:34 -0500 Original-Received: from heytings.org ([95.142.160.155]:59648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDLrU-00034B-TQ for 60559@debbugs.gnu.org; Thu, 05 Jan 2023 03:44:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1672908271; bh=U3n4XZl+xRTbm0/M3gbnkNGcCxQAaaDfq05cwlZrLUI=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=jaITkV0zIiWlqFeqMUkWZuF5tl4ZMgTX8+4VWpeIqIbI2QygBwOyISDCGvPMoXW/E PyLUqSg43FvT3xOFsjhHAWQRwMwKxOL/OfJzZtkAbQ5fRkrJvZGAEriAXul/Sjd+OP B3AGErrKhQEjGy7OIE/M9JLuG2ktn4q4xBNhXnYnMLuNIwuTfIvfiQzYQo+xxQAmLa d2gtgc8FCZuxiF8GeKnvmLyZ2b2lLjFrsEqCuurZvtFUvvVrZfWm77ongk1buL/D/H NOd61eaZC1cqybrb49qsiOfosE3wLDxsiIgC3w+aHsiyOJ9r675Z8fLBfUskEcmXRb 6MVPzHibPwsDg== In-Reply-To: <83h6x5xym7.fsf@gnu.org> 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:252576 Archived-At: > > So here's a suggestion for such a solution: we make all the *-ts-mode's > optional. That is, we don't add any of them to auto-mode-alist unless > the file *-ts-mode.el is loaded, and we document them all in NEWS and > the user manual as optional. users who want them will have to manually > activate them. This way, the original use case that started this bug > report is automatically solved, and the other use case, where the user > intends to activate one of these modes, is also served by showing the > warning, which in that case is perfectly justified: the user asked for > something that we cannot do, so we warn him/her. > I suggest a slightly different solution: add a global minor mode, say 'ts-modes'. Users would only have to add (ts-modes 1) in their init files, and the logic would be: (treesit-available-p) ts-modes nil nil => do nothing nil t => warning t nil => use available tree-sitter modes t t => use available tree-sitter modes This seems more future-proof: otherwise users who want to user the available tree-sitter modes would have to require all such modes. ATM there are only 19, but Emacs 30 could very well have twice or thrice that number of tree-sitter modes.