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: Turning on/off tree-sitter modes Date: Wed, 4 Dec 2024 15:12:46 +0200 Message-ID: References: <9cd17f8b-f88c-49f6-9024-0b6d297e18ac@gutov.dev> <867c8xsmri.fsf@gnu.org> <566ac897-ea5e-4141-bcb3-306d43c9118a@gutov.dev> <865xohrvfa.fsf@gnu.org> <86wmgwnyle.fsf@gnu.org> <178dfc7f-bc2d-4e3b-8417-a616ccc0eef3@gutov.dev> <86v7wgnxlz.fsf@gnu.org> <01d83ec8-c02b-4806-8764-38dc89a89125@gutov.dev> <86ttbzojho.fsf@gnu.org> <930f5c8e-1481-43a5-8f1d-2c13a98df74f@gutov.dev> <86r072krq5.fsf@gnu.org> <27a62624-387c-4233-b995-170270e26efd@gutov.dev> <86iks245q0.fsf@gnu.org> <86bjxt2avf.fsf@gnu.org> <86wmgg26rt.fsf@gnu.org> <56d7b33e-9b95-48ef-9c6d-c5bd14c824af@gutov.dev> <867c8f1ua7.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="36079"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 04 14:13:51 2024 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 1tIpCN-00098W-Py for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Dec 2024 14:13:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIpBa-0008RY-39; Wed, 04 Dec 2024 08:12:58 -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 1tIpBW-0008R4-LQ for emacs-devel@gnu.org; Wed, 04 Dec 2024 08:12:54 -0500 Original-Received: from fhigh-a1-smtp.messagingengine.com ([103.168.172.152]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIpBU-0000Dx-Mg; Wed, 04 Dec 2024 08:12:54 -0500 Original-Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id 358B1114012F; Wed, 4 Dec 2024 08:12:51 -0500 (EST) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Wed, 04 Dec 2024 08:12:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1733317971; x=1733404371; bh=TRHC627mxzBpEoc9QIvQUsWqau3Rw4ivGpbguHk8TCA=; b= LZjpp1z6tDKzJ0zp3ompp5vGQ/eWWrXsyuJU33yADlM2rVWNzQN28NzOBcCHAxrB oMyTgPiJhxwmh2SUR7bGio5EW1qBR3pRGVe2s1Kp4sX4WBRPYSAZQUqvEU4ETDtr C+xAPrwCzvbDBA6xzDez+YlBlvIHn9okRx3N+B/OEMDXFirssEgSm7dWfiE4hDsW wTS/QBoosRVQzyzVRatEK8cr20ND151kgf6ITDj4jTRjmlZhqhenwI3LtOuB0Q2K ZZX5q3PTSLP+SV0C6zG0adRD2f9wixaR8fovBhRgxxpZTeykShbyFgyjExC5f09V SBNPL1aLgjnvd+0xWuYnVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1733317971; x= 1733404371; bh=TRHC627mxzBpEoc9QIvQUsWqau3Rw4ivGpbguHk8TCA=; b=f IJoktHFJ6SZeA/UDzzoEwEMnMdTUFEZHmuqQN8PegReEPTGl8T5iMiN1OpWB78ww vU68ceKYXeOsQ4cQNnDc81SXzPhyi5CDkSGvadlb+qtygCHNH6SdKLvDUJH66GHA VrcnptA74KEdvJO6hcIPrOxSr9V0ClBkqudLX0A+SsHtsg7JHY5eYCl3CZ49ahvv l6uZH7R+FpkIbI2uN4jXoingbG7HW/AgDKDTIZHBBnMKrdgNJjXEcgi9o4O0YfO3 LHFctveU8aTolBcLyyNG5q0aMMFPanB+sa04k2ttqLE5lmMsmVCyAR8b8PZ/SqvE bLsiXG63lSDcUCV7+ZJOw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrieehgdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeen ucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvg hvqeenucggtffrrghtthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedt vddtveefhfdvveegudejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvhdpnhgspghrtghpthhtohep fedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpd hrtghpthhtohepmhhonhhnihgvrhesihhrohdruhhmohhnthhrvggrlhdrtggrpdhrtghp thhtohepvghmrggtshdquggvvhgvlhesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 4 Dec 2024 08:12:49 -0500 (EST) Content-Language: en-US In-Reply-To: <867c8f1ua7.fsf@gnu.org> Received-SPF: pass client-ip=103.168.172.152; envelope-from=dmitry@gutov.dev; helo=fhigh-a1-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 autolearn=ham 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:326027 Archived-At: On 04/12/2024 14:56, Eli Zaretskii wrote: >> Take for example rust-ts-mode, or dockerfile-ts-mode: the body of the >> major mode function is wrapped in >> >> (when (treesit-ready-p 'dockerfile) >> ... >> ) >> >> which checks for the grammar, emits the warning and does nothing >> otherwise. So dockerfile-ts-mode behaves like prog-mode in this case, >> even highlighting strings using the default syntax table. > That's another possibility, indeed. Its downside is that each mode > author will need to include this boilerplate code. That's what we recommend already, see the examples in doc/lispref/parsing.texi or admin/notes/tree-sitter/starter-guide. And all the existing ts modes do this, AFAICS.