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: Wed, 18 Jan 2023 05:52:14 +0200 Message-ID: <531a33ce-fc04-1723-0239-e6f509d04c26@yandex.ru> References: <84973.1672843723@hassadar.pretzelnet.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> <837cxl2dc0.fsf@gnu.org> <8BA3366D-479D-4697-9DD6-7CF26C840EA9@gmail.com> <8e8cf3ba-0efd-6bdd-84ad-103b89a23f2e@yandex.ru> <835yd43483.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6025"; 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 Wed Jan 18 04:53:10 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 1pHzVe-0001Oz-MY for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Jan 2023 04:53:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHzUt-0003C6-9K; Tue, 17 Jan 2023 22:52:23 -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 1pHzUr-0003Bx-DO for emacs-devel@gnu.org; Tue, 17 Jan 2023 22:52:21 -0500 Original-Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHzUp-00083O-G6; Tue, 17 Jan 2023 22:52:21 -0500 Original-Received: by mail-wr1-x42c.google.com with SMTP id r2so32633821wrv.7; Tue, 17 Jan 2023 19:52:18 -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=LHwql3JiWvT9HPNczxf0BXxRAwFxqtty91hp7hgHEGs=; b=G41k3A+PTc4pzpmRgbNd4Q9t3feP1d4fYEqS8N2905taNF3QiRP5d75VazYsL8Z6jM 2+X1EeGmiv3pOmF8FK3DaaJhGDKfLyjMT7IUdIa7DuFtEOk0nspwg5Ah2EgpyA7H0T41 GrR6O1sTsc8Ddhj92f+eca2A4dNBdY8EUNuIWwukPLJUJPDYQBdLc0bMoutmDeYGxDvc DKpccaLbL3W3TWbDU3oeECBZyQdG7IK+lyawoT19yiAkpP8FRjKnN5xLdZ1tm2HHBCDd It+tXACMhQV/JUOkiTtdJ8xP2HuxWTXc1scLDFY/ePut+uXR9QBIQ8PhY7+oQeA/G8on 0zzg== 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=LHwql3JiWvT9HPNczxf0BXxRAwFxqtty91hp7hgHEGs=; b=NzCz5fr7lgeJKjY5EylvVPn356SADsI8lfdG7s2xlFEyVTdUvgAzUs9rVtmmBa2wX6 6c1+VWGk4aIFHwBz4a03eeoERYJi+cxmAGaZ0lo4vLGjIbXZKPvuSiP5isnhqYjVFAgR tOPhHpHRAXEUAmDoGCIBtDvFY//nyBLEgpJiUcDca01c2v3MiIh0di4lNvsVsLeBy6HL wgdiMPs58p6cx6cudNb7/R6hfwM02lrH3SonEMz8mw/5sfqyL6AUepakYxz9ZH1sJcyA O3NCVzq09/PPfIaLtvgCfInM1KLlp1XOJ7W7IXs89ZOUDeJj6gcPmJOsIUwlj2BoMeNd wBew== X-Gm-Message-State: AFqh2ko3NJwumiTizvauSjcnDrLZjmBXrPUflya1E2iaks1xisCcsWnz sPp4ddpm4NAhGsKCDEAopsUVDvxT22c= X-Google-Smtp-Source: AMrXdXvVBjF+v43gPW9V/DzT7772x9hvNEq/swqagRTEoc8vYf7Nz0H4V2/eILdcF1pBh5SapuFFGw== X-Received: by 2002:adf:dc88:0:b0:2bb:ddc0:dcc0 with SMTP id r8-20020adfdc88000000b002bbddc0dcc0mr4401137wrj.31.1674013936833; Tue, 17 Jan 2023 19:52:16 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id k7-20020adfd227000000b002bdf3809f59sm9635428wrh.38.2023.01.17.19.52.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Jan 2023 19:52:16 -0800 (PST) Content-Language: en-US In-Reply-To: <835yd43483.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=raaahh@gmail.com; helo=mail-wr1-x42c.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:302506 Archived-At: On 18/01/2023 05:34, Eli Zaretskii wrote: >>>> Similarly, we can add such line to the Commentary of every ts mode, or even to the major mode docstrings >>> IF we do that, it’d be better to instruct users to use major-mode-remap-alist, since it’s easier to understand and use IMO. >> Sure. This way we also avoid duplicating the file name regexp. > The purpose of major-mode-remap-alist doesn't fit such use, so this > proposal is a no-go. Its NEWS entry says: ** New user option 'major-mode-remap-alist' to specify favorite major modes. This user option lets you remap the default modes (e.g. 'perl-mode' or 'latex-mode') to your favorite ones (e.g. 'cperl-mode' or 'LaTeX-mode') without having to use 'defalias', which can have undesirable side effects. If we leave it to the user to add an entry to that variable, we don't have to worry whether tree-sitter support is compiled and the respective grammar is available -- the user can ensure that. So there will be no need for a treesit-available-p check. Seems like a perfect fit.