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:21:18 +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> 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="4773"; 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:22:27 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 1pHqbL-00010v-K2 for ged-emacs-devel@m.gmane-mx.org; Tue, 17 Jan 2023 19:22:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHqaO-00084P-6W; Tue, 17 Jan 2023 13:21:28 -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 1pHqaM-00083l-M6 for emacs-devel@gnu.org; Tue, 17 Jan 2023 13:21:26 -0500 Original-Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHqaK-0005bv-N4; Tue, 17 Jan 2023 13:21:26 -0500 Original-Received: by mail-wm1-x32b.google.com with SMTP id j17so4443396wms.0; Tue, 17 Jan 2023 10:21:23 -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=IHrit/HkOwaOuhL9Od+7Yq3iYVHHIrSe6drR50/eB4w=; b=bC/ZMS/NYYrgFCpziTc1FqqE0CEzrrTjRFoGV9xEuM/DPf9WiNWlDDVZ/zBUuiUvt4 0wItX/WmP44rw751po/ReBxvb/LjCrkqXRdQUWGuHnNOkl78cC4OTXPmq18g1uQFDANb q2kZH+jA0m7XIdevTgmhn2HTpgJPbKIK9/ZjhBFEHPRTu3kaASEj0VjmoT2otiEAbAek Tdc//lEYgoZ9lv/zCXRyzGPVpevBbRZ3rmdOeSKhXpRODmm2Yp5VHlTFmcVLTAoGkr5V XxBpW7YpbmQKNuSP2AYlAIIEBfIN5s0mMKFLaVk+IjJgYpRWq3QsM8eo90myOEBM3hI/ nsTQ== 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=IHrit/HkOwaOuhL9Od+7Yq3iYVHHIrSe6drR50/eB4w=; b=DrVf5wav6f2erxsIvAPzC+aE9a5f7OOpIF7n5zbBDSVbjuLCcS3jZZt7Vgl26Umgw5 jJV7sYgBVqfEsyLgZwz0kqUs2h4CkOGFRMX/ctf+Iu4weRwLq4zxsu/evuPgrFapdF0y WK3kUnBojZ2UAu453xzCkIoHjEKNLW9d2ki/LlnPGK1mgIoPYZpMjSY10rkz7bnn+hMI YTQiHsHGeCBH3UaEaqTox1FOq4z2qyyMhtVvxKitwbgQh/F2PDcoft2nnNot4izvJ2mw dcqhxd0NtVjgnHsKHMz0vK6tf5/BBDonTh8bP87xhTOCWuxmi+sd3l6n5jqLHI3cwqqu 9DzA== X-Gm-Message-State: AFqh2koPnwJXEpODV4zg1V+c6rZwjc3cWxrendN98wgh7s9b6KQjf9K+ OdZcnCm4TER3MFI9CObartPTeqN6V4M= X-Google-Smtp-Source: AMrXdXumMwBntbCCLj4tkHSa2kOCYPXqnnLQJbBil3rn466NT92I6QqNvG7RIm80QKwvFtQeYBQFVw== X-Received: by 2002:a7b:c5c4:0:b0:3d7:889:7496 with SMTP id n4-20020a7bc5c4000000b003d708897496mr3950620wmk.17.1673979682691; Tue, 17 Jan 2023 10:21:22 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id h11-20020a05600c2cab00b003db0ad636d1sm2485921wmc.28.2023.01.17.10.21.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Jan 2023 10:21:21 -0800 (PST) Content-Language: en-US In-Reply-To: <83cz7d2g1u.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=raaahh@gmail.com; helo=mail-wm1-x32b.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:302494 Archived-At: On 17/01/2023 20:04, Eli Zaretskii wrote: >> Date: Tue, 17 Jan 2023 19:59:04 +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 >> >> I also don't fully understand the benefits of your proposal. Suppose we >> apply it. You talked about how easier it will be to document the new >> behaviors if all ts modes are consistent. Okay. What are we going to say >> in that documentation? >> >> Let's say there are two users, Bob and Alice. Bob has tried out >> yaml-ts-mode and wants to use it regularly. Alice has tried out >> js-ts-mode and also wants to use it from now on. What will be our >> recommendations for them to make that happen? > That's already in the patch that I posted. Suggestions for improving > it are welcome. This part, right? +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. 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? 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.