From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Make all tree-sitter modes optional Date: Mon, 16 Jan 2023 09:12:23 +0800 Message-ID: <87tu0r9tag.fsf@yahoo.com> References: <84973.1672843723@hassadar.pretzelnet.org> <83wn62xi3k.fsf@gnu.org> <83o7rexe2n.fsf@gnu.org> <83h6x5xym7.fsf@gnu.org> <83h6wr6gmz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16286"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: casouri@gmail.com, monnier@iro.umontreal.ca, larsi@gnus.org, theo@thornhill.no, jostein@secure.kjonigsen.net, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 16 02:13:24 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pHE3v-00047h-OO for ged-emacs-devel@m.gmane-mx.org; Mon, 16 Jan 2023 02:13:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHE3G-0000oh-Aw; Sun, 15 Jan 2023 20:12:42 -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 1pHE3C-0000mv-JA for emacs-devel@gnu.org; Sun, 15 Jan 2023 20:12:38 -0500 Original-Received: from sonic312-25.consmr.mail.ne1.yahoo.com ([66.163.191.206]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHE3A-0001fC-Or for emacs-devel@gnu.org; Sun, 15 Jan 2023 20:12:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1673831554; bh=sxnOWNsPQP1hoPj101K/8XsMDSQBnyNzEVlXx1XkDj4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=MnEgbrJzVCbyvfhsxp8f6r1XrMXNvmrj6kpjpSpIwSuvaYnrCQfDoCQAJ03yzfRJgwgfE6mEEHktMed46uxI+JCsLxYwts9gmXnkH2mtE3zp5UVDzr2iqX9UNE99323FS+YvKtDKypy6cLyeu3C7iw2bEMJBFP7beV1W3Jp3EpVdk4ZIfB2NdaW0n+5x01QT2LDFuzURNG22sYI/RWKoNh+zsKXu4/EQeDLz+o90vYBtnN5WotdoWcysJrlt9VCtbDh3K8oJtK11ahFvjGUgp++9186biyPYekRUV3RbqXeZaH8C/ez4oOeXj9Q7JfSm1HE6k+EZBNtIVAeEfCda6Q== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1673831554; bh=JzR+gvTiBYlXGmPZ6TWqSklNXZqHKhCmDVda979KECN=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=MWpn7ZTL7fHSPvdFGUU4pIM49y6IhlnC83sjvUFeOSeA8c3ranPajZwPT8U6G2V4E9Gwb6Uav2k+MZZh3s8XFENgRj4YsOBUq8d8qZEMKDid7UNAv9mzuIXGypJGypGv4LN9rA0lMXA5q53UdvsSwE4NpYMlgH4dqXKerNAM4QN4vocRsUjbl90GjkH9iH3G/wFSklgX1r3lD6NRZu4pApMimnMkQ0IXaqaOVj2ezpc90pmmEsdi+aO4nTFCVqiHlm1E7xAAIc2x6WfbFI1nzMNEoQDT5omKxRYJ4G+4JQnw8UOIcNlpOXsxa5wGN36/m1HDQJUM/CCocrXiyr803Q== X-YMail-OSG: fyk2YVgVM1kfcdyv4STG31WQlNfv7lbhhEGgaVq7WTFqJIRiMABk34xdHYEnQCi 8UEo_hpUpN4kEaPpXh8WmrVXcF_IuAnXgi5pTDiY_o.DiKmcn1uKId17FGGYezV8.4g7XXRqVkD. abzmyHHhqTnX18TewQ1oSbgEFIaSOJkSLxbccKgKILyDlAzSXUu_Z7sPrXGz5JOLeYdBGxBO.3Uv 0JoOB074ai7lUmm3mIFisQlvGxkpKBeqwcxfmlv.EeQzvDdOGl1TUMMB6wIDRimbJMAu_Kobxf_P 54nzF6uUqUOsijB9l7R4HLQLP0WC4UjpHfP.7m9eryuep31h6RiXiaURJ_M8cH.lw12efkMvszz4 T78f.T8715hKblJAeEDyWZGqF4LFvK8Tse.BmIroUQV3YKLDKBd13m3Bi0uIsTqdD51sp5UI8wHA yDp7C_kFFc2ZAXaB46fRGWL3OvfhMkEwjNXi3ttr1aJFpUjRMz3hPPfpiVAMJj6AXUXjMPz_Y_gn Syz0pTHZ3PD8YJv10NkgzqQztjjkUTuHa3epG7.bu9c154xUEepBRBM.alJlFtVYMHgXORC7kqkb 9HE0WuBIQ89318rpZaCADy5QWeUquFUA73huirJhd3eed24RccrH1iXs_DnZff4S1DbhFNE3trLr Dw0l5zQjEVQhuyDOv6c0AZR9vkSIJPuIFp94LtUvzYprsNWSgsAFz2._NZVYHI8zoLB2U.xYHxoo HDfY39ri.8oK40bKemY.Ct4YOTN31eyyUp6f6bFzQNlAbrPnICxniujLFPwF4rK1BCWe9WFPyQSv GS4lf_VUx_cO7FrTVm_7Zgb4kLtr9phLJ50O5vwQNX X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Mon, 16 Jan 2023 01:12:34 +0000 Original-Received: by hermes--production-sg3-5ff5bbd69d-mpzp7 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 1f30be9b40a91fff91a1fc2662baf26e; Mon, 16 Jan 2023 01:12:31 +0000 (UTC) In-Reply-To: <83h6wr6gmz.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 15 Jan 2023 16:01:40 +0200") X-Mailer: WebService/1.1.21062 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.191.206; envelope-from=luangruo@yahoo.com; helo=sonic312-25.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302440 Archived-At: Eli Zaretskii writes: >> 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. >> >> This is a retreat of sorts, but I think it strikes a better balance >> wrt user expectations, assuming not everyone will build with >> tree-sitter. > > The proposed change to the current emacs-29 branch is below. You will > see that where possible, just loading a TS mode modifies > auto-mode-alist if the tree-sitter support for that mode is available, > whereas for other modes auto-mode-alist is modified only when the mode > is actually turned on successfully for the first time. This is > because some of the TS modes have their own *.el files, whereas others > share a .el file with other modes, and so loading that file doesn't > necessarily means the user wants to use the tree-sitter based mode. > > With these changes, users are supposed to turn the mode manually when > they want to use it, or customize auto-mode-alist in their init files > to turn those modes automatically for certain files. Modes that have > their own *.el files can be just 'require'd in the init file to modify > auto-mode-alist. > > This arrangement is perhaps not ideal, but I think it is safe enough > and simple enough to go into Emacs 29. > > Comments? objections? ideas for improvements? I will install in a few > days, barring any serious problems. Thank you. I think this is a very reasonable arragement, certainly better than what we had before.