From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Make all tree-sitter modes optional Date: Tue, 17 Jan 2023 20:49:59 +0200 Message-ID: References: <84973.1672843723@hassadar.pretzelnet.org> <83wn62xi3k.fsf@gnu.org> <83o7rexe2n.fsf@gnu.org> <83h6x5xym7.fsf@gnu.org> <83h6wr6gmz.fsf@gnu.org> <831qnu64la.fsf@gnu.org> <83o7qy4l2v.fsf@gnu.org> <55d39dcb-de2f-fe02-e069-f1dd1e50e59b@yandex.ru> <83edru4jaj.fsf@gnu.org> <83sfg92ryn.fsf@gnu.org> <83pmbd2oy6.fsf@gnu.org> <0380a032-bca0-4225-6f9d-853de49f100f@yandex.ru> <83mt6h2ix7.fsf@gnu.org> <2c61c7c9-da8d-1073-5079-8391f77fefa7@yandex.ru> <83ilh52ha3.fsf@gnu.org> <83cz7d2g1u.fsf@gnu.org> <83bkmx2ef2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29175"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 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 Tue Jan 17 19:50:45 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 1pHr2i-0007LX-Vy for ged-emacs-devel@m.gmane-mx.org; Tue, 17 Jan 2023 19:50:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHr2A-0005uR-DC; Tue, 17 Jan 2023 13:50:10 -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 1pHr28-0005rP-Gk for emacs-devel@gnu.org; Tue, 17 Jan 2023 13:50:08 -0500 Original-Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHr24-0001my-RD; Tue, 17 Jan 2023 13:50:06 -0500 Original-Received: by mail-wm1-x329.google.com with SMTP id l41-20020a05600c1d2900b003daf986faaeso5327409wms.3; Tue, 17 Jan 2023 10:50:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=95H7hHIF2k5v/3EiV3CsGYOxVXvNzRTk4put60RiVBA=; b=c4zx5LKbHXzhpSD8uDCj2H0WuZWL/rxUHHZtZuwQ0qu2pk6shX09BIng3x64p/I6zh HeHsSUmgEzdUroXl29trYk2F9PANpI9uzCSQI4mZidBf78P3ZSXwgI8tJzZL6rDAZJgQ V2g0j/oTEVu+I+KVnZGF75lV+A+X3EdXUqdLJswOC/3jb58IAfqKj2DyHgCESRSKcbTq Yyq1/WwNaev7eNr+lnF27dhVf7TQ/g2BBXg5AAG8BazAp7/7hyIxH+hdPmTn1Iwc7YEP SSuLe4MZpLcakZxNoSH+6jb1IDYEkm5tPl2rM2sJX506mBM58vewpQqp0xk1uFABLphb SgLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=95H7hHIF2k5v/3EiV3CsGYOxVXvNzRTk4put60RiVBA=; b=X0rT6i1G4KQ5Yk6BKYD3ixEORsLQTbn7xA1LHqEnn2BOY2bHM8LXd4S/L5MAPnj1Y9 fbDhVz8AaU+mUC3/W9C7Us+A5Fee1YJwGE33yaTWKc2pAVMytnygf4ouYIAszeVlFzuQ /VgD+yiPUxa5m/VsUO35BPD58jyqf82DknZYRJykjYDPuitFwjXk+8VHQg2+pHRJ4puf 1J/ZBv/zRZIU+KplYUhOo+Gq92a0Dv7pVBrTdMMPCrTST+3eBiNe66EbMcm28S0BaztX HVmpzXZ6gW4JL9nXisVyO0V9Bkx4tXF4rCueFWUkbeFEl/2SCkSjMjhcQIzI26ZP0ryU bTTw== X-Gm-Message-State: AFqh2kpotFSAU4BkSinCRk0kFBVWUlzDPadLL2B/7k0P3HDxRKMNPteU +eSn3CtsWPgC14KpQrpj0AP4DM467Vw= X-Google-Smtp-Source: AMrXdXtK2a+ug3l9vY8kvcdR7eQ+T7JW/rBuMk7Pkh8zUzEfgqmNBg9OqwXmvPZLzXUh5kQPQhh4CA== X-Received: by 2002:a05:600c:2d0b:b0:3da:fcf0:a31d with SMTP id x11-20020a05600c2d0b00b003dafcf0a31dmr4230099wmf.22.1673981402343; Tue, 17 Jan 2023 10:50:02 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id m5-20020a05600c3b0500b003c6b7f5567csm19552570wms.0.2023.01.17.10.50.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Jan 2023 10:50:01 -0800 (PST) Content-Language: en-US In-Reply-To: <83bkmx2ef2.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=raaahh@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.097, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:302498 Archived-At: On 17/01/2023 20:40, Eli Zaretskii wrote: >> Date: Tue, 17 Jan 2023 20:21:18 +0200 >> Cc: casouri@gmail.com, monnier@iro.umontreal.ca, larsi@gnus.org, >> theo@thornhill.no, jostein@secure.kjonigsen.net, emacs-devel@gnu.org >> From: Dmitry Gutov >> >> +The new modes based on tree-sitter are for now entirely optional, and >> +you must turn them on manually, or load them in your init file, or >> +customize 'auto-mode-alist' to turn them on automatically for certain >> +files. >> >> I thought there would be something more in the docs, given that the new >> behavior is unusual. > > What do you suggest to add? The design doesn't really make sense to me, so it would be hard for me to explain it to a user. So no proposed docs from me, sorry. >> But I see you are referring to auto-mode-alist here, modifying which >> will still be necessary for js-ts-mode and python-ts-mode. Which will >> touch a lot of users, possibly even the majority of tree-sitter >> enthusiasts, given that JS and Python are some of the most popular >> languages these days. >> >> And yet you rejected my counter-proposal claiming (if I got your >> position right) that modying auto-mode-alist is difficult/annoying/etc >> for an average user. To quote: >> >> - Customizing auto-mode-alist is not the easiest task, it >> requires good knowledge of Emacs regexps and alists. So >> asking anyone who wants to try using the tree-sitter modes to >> do that is not the best idea from the POV of user-friendliness. >> >> So which is it? > > Both. I mention auto-mode-alist as the last alternative, for those > who are fine with going that way. It isn't black-and-white. But it's either that, or "turn them on manually", right? That would also work with my proposal. >> To "try out" tree-sitter modes, the users can 'M-x js-ts-mode' or etc >> either way. But to switch to the said mode, they will need to deal with >> auto-mode-alist, again, without any alternative. > > That's specific to js-ts-mode (and one other, I think) because they > share the .el file with a non-tree-sitter mode. If there's a > reasonable way to give them separate files, things would be easier. Right. If they were in separate files, then we could write the doc with suggestions to merely violate the standard recommendation of avoiding 'require' in the init script. > But this is not a documentation issue, first and foremost. Inconsistencies in design often turn up as documentation issues later.