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 16:32:30 +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> 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="29747"; 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 15:33:39 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 1pHn1v-0007Uy-GN for ged-emacs-devel@m.gmane-mx.org; Tue, 17 Jan 2023 15:33:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHn16-0000Kr-Jt; Tue, 17 Jan 2023 09:32:48 -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 1pHn0w-0000KN-0Z for emacs-devel@gnu.org; Tue, 17 Jan 2023 09:32:47 -0500 Original-Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHn0t-0003ky-Ov; Tue, 17 Jan 2023 09:32:37 -0500 Original-Received: by mail-ej1-x631.google.com with SMTP id mg12so3451953ejc.5; Tue, 17 Jan 2023 06:32:34 -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=s+jPVqfYeVVOmCmvpnzQDXk4LARhGuNqGGHatarxdEY=; b=fjmPFszhNt36fBri3FolYaCyn7o0fL/ow22FDcYQ4GPZXoyOZt0ZMLz8W27+o/Xktk xnhHfT+nwbpw27ilVwpm9aSmDyLkFpCXVx78lbltXAwY5RgReV1g37Lv6++ngRctNLKl nbu2kYpDo8Oo+Ur3r1TnwT4f1dUSmd5nQ+kVIZJ5YOgHZRZEgx/WhUGim0ay02obage7 HmDC4QHDFsgxmY+VAytUeu+1uynJHvd5tiQwwZqUhgzI0Ur7yIOAuFqMvd6Ih619jaFL npSU+/qnq580yiKOvJTcycI/yYrOsLVMv9LHPAKkLFcVsbaSux8zKvB1dLX1aWjTohgB gRSg== 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=s+jPVqfYeVVOmCmvpnzQDXk4LARhGuNqGGHatarxdEY=; b=xIBsErVV5LKfChgl4RWUYUyjh502FBuN0fDY+2skxsuZ/HxLzL2tGhXzqvI3JKSl53 4Ak+H9O9tVSr4ULU/NnB+3A78Cau0zjKsIY6PiddXm48GHF0ngYxwx8hVZM2lg2cdFgQ cdRdJ+0Pc6JPIICQ+ns68LqQLHmVIIlnvxg0S+dk94tGIkcwzf8rDXjf29K7PcdWTmf0 D/tMUeYEKIOKrwjIpfUYS381Si3gvC4P8PnNdgMIgYTo7XDUz0BO6TXLPrWbxKvEItCH wWjW6mOmEaSejAW6Azyagaax0VRTQjeIwdjq1me4V3H4DGlBp2TyvNzEGYkyQV88qwVq urXg== X-Gm-Message-State: AFqh2kqkEGwaAJailUInTF2o0dSbLde294m3pw8yP+N0PamHy841A19W 1Ys4rvE4DH4trglXLVVJv26iKwjWLVc= X-Google-Smtp-Source: AMrXdXuAZR91sAIb4eSayMzc8jM3HK59GHLwR7/M9T+bwIdibkbx7AI3qFTRm4iLrz01FTLydF9SVQ== X-Received: by 2002:a17:906:f907:b0:7c1:e78:11ed with SMTP id lc7-20020a170906f90700b007c10e7811edmr3403543ejb.0.1673965953369; Tue, 17 Jan 2023 06:32:33 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id qw25-20020a1709066a1900b007ae1e528390sm13142937ejc.163.2023.01.17.06.32.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Jan 2023 06:32:32 -0800 (PST) Content-Language: en-US In-Reply-To: <83sfg92ryn.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=raaahh@gmail.com; helo=mail-ej1-x631.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:302478 Archived-At: On 17/01/2023 15:47, Eli Zaretskii wrote: >> Date: Tue, 17 Jan 2023 14:59:06 +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 >> >> On 16/01/2023 16:59, Eli Zaretskii wrote: >>> You can file a bug report if you want, but it won't count because it >>> won't tell anything we don't know already. >> >> The fact that it will make it a pain for me to test ruby-ts-mode in >> "regular" sessions was something you'd been aware of already? > > Please tell more details about this aspect of the issue. I'm using ruby-mode, at least for now, while all the wrinkles with indentation haven't been ironed out (and we'll probably not manage to get them all 100% right before the 29 release), and while ts modes don't support show-paren-mode like SMIE does. No proper sexp navigation, etc. So here I am, in my normal Emacs, working. Suppose a bug report comes in, I switch to a new buffer (maybe visiting a pre-existing file, maybe not), turn on ruby-ts-mode, reproduce it. Then try to fix it. From that moment on, my current session has a different major mode associated with Ruby files, and I have to deal with that somehow. Or a different scenario: Recently I had to investigate worse font-lock performance of ruby-ts-mode compared to ruby-mode. How did I test that? I started a new session and visited a bunch of existing files. First I run the benchmark in ruby-mode (which it's associated with by default), then I switch to ruby-ts-mode, repeat the benchmark, compare the results. And I do that for a number of files. With your change, the first file will start with ruby-mode, but the second file and the rest will start in ruby-ts-mode. And I would somehow need to remember that change and account for it when evaluating the results. What's your recommendation? I suppose I could add these two forms to the init script: (require 'ruby-ts-mode) (add-to-list 'auto-mode-alist <...huge regexp from ruby-mode.el...>) ...and then update it over the years if new entries are added there over the years -- by the way, having a separate regexp in ruby-ts-mode.el is an unfortunate duplication. But that will only affect scenario 1. The second scenario is fairly likely to start with 'emacs -Q' (to try to eliminate the effect of user customizations). Also try to imagine some prospective ruby-ts-mode contributor who is not one of us, but who's also trying to test and compare the two modes.