From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Make all tree-sitter modes optional Date: Thu, 16 Feb 2023 11:45:30 -0500 Message-ID: References: <83o7rexe2n.fsf@gnu.org> <83h6x5xym7.fsf@gnu.org> <83h6wr6gmz.fsf@gnu.org> <868ri140sr.fsf@mail.linkov.net> <83fsc92gbz.fsf@gnu.org> <83cz6ccagy.fsf@gnu.org> <838rgzaqmj.fsf@gnu.org> <7bad77ae-a176-d49b-5115-dbadf7e6d1bc@yandex.ru> <83cz6aaeys.fsf@gnu.org> <837cwiae2c.fsf@gnu.org> <83r0uq839h.fsf@gnu.org> <83pma939c4.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="11356"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: dgutov@yandex.ru, acm@muc.de, juri@linkov.net, casouri@gmail.com, 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 Thu Feb 16 17:46:26 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 1pShOs-0002kL-CH for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Feb 2023 17:46:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pShOH-0006jY-Lb; Thu, 16 Feb 2023 11:45:49 -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 1pShO7-0006Xd-CF for emacs-devel@gnu.org; Thu, 16 Feb 2023 11:45:39 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pShO5-0001M6-2j; Thu, 16 Feb 2023 11:45:39 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5E83C442A89; Thu, 16 Feb 2023 11:45:33 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B57F5442A57; Thu, 16 Feb 2023 11:45:31 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1676565931; bh=q4oOv0QlG7ATt9uiYAa0yuwIczZMcpcaOAr+rW/hBzs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=QgNtudqGIALwo1T5HlKfpudwn9WzRCqJnZfzw/fjB/TNrFhbW0wqju+cxxduLPKw7 bduvwe0DGbYlQYvVXRwuZqnEIPbUcHGfaB9h7amBbgXiaLNNO4YWzZg1HjYjnSjIud RDxbQfCcHCTK6Mhm+MDIs8J66BFZC266u03yAStkQ0gXqdAgC+7onXjTPrdgPmYVri /9Z6+FobbmMTQZdf/QufPIr7Y3obhPihAxT6kjhZ30BI1FWqBNHeQwx/eHP/GZbQj1 LRw3W/C8ZtifJaeSBEW4xbmQbF7ueORoC79EO2WrpTPYwuqRqw8hX+5TvcJr7QDwGY FjpQsveZfyHIg== Original-Received: from pastel (unknown [216.154.34.24]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 428091231E2; Thu, 16 Feb 2023 11:45:31 -0500 (EST) In-Reply-To: <83pma939c4.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 16 Feb 2023 17:42:51 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:303428 Archived-At: >> But with my patch, trying the modes is exactly the same (just `M-x >> c-ts-mode`) and turning them on in their customization is no harder >> (since `(c-ts-activate)` is no harder to type than `(require >> 'c-ts-mode)` > Sorry, I don't buy this argument. Care to expand a bit more. >> we could also make it a global minor mode so it can be >> done via Custom if it's considered important). > This was considered already, but had its own issues. Can you mention at least one? > And we have ran out of time needed to look for better solutions. (I > personally don't believe there are any that weren't already proposed.) Giving at least one downside of the patch I propose compared to the current code would help me understand your position. > We'll have to make this one exception to the rule. The situation > itself is exceptional and probably won't happen again soon, if ever. I understand there's time pressure. But I think this would argue towards making the code more conservative (e.g. not change the defaults at all, not even after enabling `c-ts-mode`) since that's much less likely to bring problems now and in the future. E.g. if users do as (require 'c-ts-mode) as you suggest, they'll bump into a regression when they move on to Emacs-30 where we will have hopefully fixed this misfeature. I think if we want a quick&dirty short-term way to encourage the use of tree-sitter by enthusiastic users, we should provide a "one stop shop" function which redirects all applicable major modes to their tree-sitter variant. It's easy to write, it's non-intrusive, and future-proof (it should be easy to preserve that function's approximate behavior in the future, regardless of how tree-sitter's integration evolves). The current code will bring bad surprises to some of our users when they try Emacs-29, and it will bring further bad surprises later when we move to a different solution. The fix is trivial enough that the urgency doesn't pose any problem. Stefan