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: An anonymous IRC user's opinion Date: Sat, 12 Oct 2024 23:27:01 +0300 Message-ID: <9a8b97f8-def3-43ce-b71b-1f09bb05afd4@gutov.dev> References: <87plodsjsd.fsf@web.de> <865xq14dwp.fsf@gnu.org> <343c4d04-af53-4da2-9d1c-c616c74821e1@gutov.dev> <86plo8369c.fsf@gnu.org> <63edeeea-1f24-4d3b-abc8-b96b164942e4@gutov.dev> <8634l1zsej.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="1356"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: johan.myreen@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 12 22:28:00 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 1sziiV-0000BF-8A for ged-emacs-devel@m.gmane-mx.org; Sat, 12 Oct 2024 22:28:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1szihk-0004hd-Pr; Sat, 12 Oct 2024 16:27:13 -0400 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 1szihi-0004hU-UF for emacs-devel@gnu.org; Sat, 12 Oct 2024 16:27:11 -0400 Original-Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1szihg-00020Y-EW; Sat, 12 Oct 2024 16:27:10 -0400 Original-Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 2095F1140108; Sat, 12 Oct 2024 16:27:06 -0400 (EDT) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Sat, 12 Oct 2024 16:27:06 -0400 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=fm1; t=1728764826; x=1728851226; bh=/5tO96ZeZ8ewStRgbSGYBhh519Wqgnuavvq6dJZ6Avg=; b= UbZRMzjEnjESaK7QM5lKOX30uCJkOOey1VearJfVUybiRxKYnGzj7MMdddD/zMkQ N9pvE4QyOo7TDyO4+QuM690A0P94Ela1yHO/4HXkTAO/ex13/8PvmFI/WbzAZU0N u3mvKGt2Fw7jbe/yXYkHZ6O8nxZhUVTW2c0U2pbprtPhWR6Us07/7RSVQiR4KMw8 X2u/ckhOxDygK/ieF3PjwrgJlC2qDPhHcESQ+uOidoHLnxIaoe2/h6dwe8vzPggb 3dB1rtHoa128X45QI+BWrivKr9OjpBoyNVDn2I3K+TetGG+R4CDDkWw/W+fWKLAZ mojlPNSDslwgalpLdy8rpw== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728764826; x= 1728851226; bh=/5tO96ZeZ8ewStRgbSGYBhh519Wqgnuavvq6dJZ6Avg=; b=h G38H2LLQ1lwzX/nTjtHylz/xZkL85WP87BlkDz48gpIfk3AaU/EBDevNiIOoANLW z2/R/bba/usPYtld8xTPmWKjCyy38SqDgF7KY/uGWBNLy0hVZf+DnxXisQe0nGlK +CSAsXRoXiRafy67CWth/OcJiF3PRmRXFv+dhCrm08E3fvLS89ybp1uwFBXChZaL NhcjRwXYSa6JdfCbjFPQUnc29X0scPT6LyuK/mmLRKD2790BrjlY3uJOURis2NhT bruXeiOxTfkETK/kfX6hOz3y6z/w6r8thk6gEr9ad1lVhbt9Q3F/eTqQPNCOWAW+ K9cRJeTUMG3IhncyGDpOg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeguddgudeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddv jeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrd guvghvqeenucggtffrrghtthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeu fedtvddtveefhfdvveegudejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvhdpnhgspghrtghpthht ohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepvghlihiisehgnhhurdhorh hgpdhrtghpthhtohepjhhohhgrnhdrmhihrhgvvghnsehgmhgrihhlrdgtohhmpdhrtghp thhtohepvghmrggtshdquggvvhgvlhesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 12 Oct 2024 16:27:03 -0400 (EDT) Content-Language: en-US In-Reply-To: <8634l1zsej.fsf@gnu.org> Received-SPF: pass client-ip=103.168.172.159; envelope-from=dmitry@gutov.dev; helo=fhigh-a8-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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:324521 Archived-At: On 12/10/2024 10:34, Eli Zaretskii wrote: >> Actually, thinking back the last time we made such a move, we got a >> report from a user who preferred to have files in question (*.toml) in >> fundamental-mode, because they didn't want the hassle of installing the >> toml tree-sitter grammar (bug#60559). >> >> The said user didn't have Emacs compiled with tree-sitter, so if we >> wanted to revisit that issue, we could enable ts mode globally when >> Emacs is compiled with that support, and when it isn't, keep them out of >> auto-mode-alist. > > If we want to be selective, we should also check if the grammar > library is installed. > > Or we could tell the user, when a Rust file is first visited and the > grammar is not available, that we recommend to install the grammar. Telling that the grammar is not installed is still useful. Even if we say "grammar xyz not available" only once per session, we still have to decide whether the major mode switch happens (with perhaps reduced features - such as non-working indentation/font-lock/etc, but with for example Eglot recognizing the file type now). > Either way, this is not very trivial, and someone should do the work > of designing the best UI and coding it. > >>> I even pass --without-tree-sitter to configure now. It seems >> particularly surprising to me that I explicitly tell emacs "don't >> use tree-sitter" and then it immediately starts complaining to me >> that it doesn't have tree-sitter. > > Feel free to improve what we have. My point is that it is not very > trivial; what we have is basically a compromise, which could be > improved, at least for some languages, if we want to be smarter. The proposal I'm quoting is straightforward: if Emacs is compiled with tree-sitter support, enable the modes and warn when the grammars are not available. If Emacs is not compiled with tree-sitter, do neither. That kind of rule has predictability: for example if the grammar was not installed originally but the user did that while Emacs was running, the corresponding major mode will start working the next time the user tries to enable it. That wouldn't be the case if we conditionally alter auto-mode-alist based on grammar availability. The above approach should be quite easy to implement, if there's agreement to it. Otherwise, the issue is about choosing the details of the UI first.