From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Make all tree-sitter modes optional Date: Wed, 18 Jan 2023 14:06:16 +0200 Message-ID: <834jso2gjr.fsf@gnu.org> 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> <531a33ce-fc04-1723-0239-e6f509d04c26@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34979"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, monnier@iro.umontreal.ca, larsi@gnus.org, theo@thornhill.no, jostein@secure.kjonigsen.net, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 18 13:07:09 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 1pI7Dh-0008r5-9M for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Jan 2023 13:07:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pI7Cx-0006oJ-Ow; Wed, 18 Jan 2023 07:06:24 -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 1pI7Ch-0006VF-GU for emacs-devel@gnu.org; Wed, 18 Jan 2023 07:06:11 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI7Cf-000706-VV; Wed, 18 Jan 2023 07:06:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=dxjlJBLeD2szrqStqlVFwq1vLSw2Kpw1V0AMlXSe5SQ=; b=leKCvoCJHmJc+InxLWEC CiS7GW0gdSUU2iJj+4ZlzfLnoTahER0ZHbl0a1NnSupwFOAD+edybJOe0/6Hhj0GLFrYh3CHNLREF 3x4J/E5PdpcNcEW9YtU8Ut8HPpTi+NY1pkOAqef7983WzFuIskt3txfRGuotuWJYzvoi/0naXxULB oXHhRY3rdzkDlKfHAF4p5WUmADtAEsV9cMUbX9xwYj17+nkXwn4IFCRUGw5dWF67qTzi4WaiJKiaq sQnGR/xhjLGqgXCKu4wpL6PCQc1IABTdREwy7qrPS3C+rFCwmSd5CheNRPKdeNI80+ysrO1Sy9A4/ 8yRWF1IbKvNzpw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI7Ce-00067I-2M; Wed, 18 Jan 2023 07:06:04 -0500 In-Reply-To: <531a33ce-fc04-1723-0239-e6f509d04c26@yandex.ru> (message from Dmitry Gutov on Wed, 18 Jan 2023 05:52:14 +0200) 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:302511 Archived-At: > Date: Wed, 18 Jan 2023 05:52:14 +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 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. We can _suggest_ using that variable for this particular purpose, but we cannot make it the only or even the main means of dealing with the issue: this is a _user_ variable, and users can have needs or reasons to do stuff with it that are incompatible with the kind of usage proposed here.