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: An anonymous IRC user's opinion Date: Wed, 20 Nov 2024 14:59:15 +0200 Message-ID: <86ttc2rrh8.fsf@gnu.org> References: <86ses8x1po.fsf@gnu.org> <865xp3w64u.fsf@gnu.org> <61171da3-7428-4572-bc13-783766a123b5@gutov.dev> <86v7x2u7rz.fsf@gnu.org> <86msidubg4.fsf@gnu.org> <867c9htwt7.fsf@gnu.org> <387887a4-ba19-485e-8805-d1aabe2058ff@gutov.dev> <86y11xsbil.fsf@gnu.org> <17465b85-430a-4e91-8b12-769b60181ada@gutov.dev> <86ses4sglw.fsf@gnu.org> <86fro4sddd.fsf@gnu.org> <6ac73c67-cb2d-48ef-8f1d-683c5335aba5@gutov.dev> <8634k4s2r2.fsf@gnu.org> <082b0388-b3a1-4523-9f9b-5ead4b110e11@gutov.dev> <86plmrtemx.fsf@gnu.org> <7aa4a684-3374-4d0f-8efc-c4df29337c5e@gutov.dev> <86cyirtahu.fsf@gnu.org> <556779b3-9308-4fd3-9050-bf9c49658cd1@gutov.dev> <864j43t8t9.fsf@gnu.org> <4cc676e8-cac5-4348-99b0-243baf74687e@gutov.dev> <8634jnt5e3.fsf@gnu.org> <4864104c-cb23-4356-ad89-2fea111db66c@gutov.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22185"; mail-complaints-to="usenet@ciao.gmane.io" Cc: johan.myreen@gmail.com, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 20 14:00:17 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 1tDkJU-0005HB-A5 for ged-emacs-devel@m.gmane-mx.org; Wed, 20 Nov 2024 14:00:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDkIl-0004T2-QT; Wed, 20 Nov 2024 07:59: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 1tDkIi-0004Sj-O4 for emacs-devel@gnu.org; Wed, 20 Nov 2024 07:59:20 -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 1tDkIi-000292-BN; Wed, 20 Nov 2024 07:59:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6VHQ/Yg8TpE4l4L/MsdHQhctWRtTpQcGobpF/dhKjJc=; b=VcstE3GSOFCx YoWsJ/95AZqL9dzDv9TsBxGr6tXzdT9PMmpxvCZXjqVunONjTGOTaK8WN4lhSVqZXJHmvM+h0Jar/ 2vAYvbvPGfPBo3Tr0NOImQOhODX7OsEZxABYCIYU53Y4f12GALtkWagHYZ6l6qYxdhyZwRmEUm2SC KBzq+vji4hL2nJ0ETrboqOEq7zpymx0LOnOy3bS0qsxZorvBuw1IlWMHCdfFzxml5DZioJhsh/A9Q 4W1dlBr6gMmLO9beTWFF9fq4y7eP+Jr31UFQBwdRLAbiqZmUWDQnyNggjaE2aRnAknYvhhENa1Smq TSbwynV8YUQl5LBWllFxOg==; In-Reply-To: <4864104c-cb23-4356-ad89-2fea111db66c@gutov.dev> (message from Dmitry Gutov on Tue, 19 Nov 2024 22:12:09 +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:325518 Archived-At: > Date: Tue, 19 Nov 2024 22:12:09 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov > > On 19/11/2024 21:01, Eli Zaretskii wrote: > >> Date: Tue, 19 Nov 2024 19:56:05 +0200 > >> Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > >> From: Dmitry Gutov > >> > >>> Wasn't the idea that the user will tell us which files she wants to > >>> visit in each mode? > >> > >> I think we talked about making the option more granular (allowing to set > >> it not just to t, but to a list of modes). That will be easy to add. > >> > >> But specifying the files as well is news to me. Wouldn't users who want > >> that level of detail just go and customize auto-mode-alist instead? > > > > Maybe so, but that is not always easy nor user-friendly: getting the > > regexps right is not trivial, many people make mistakes. > > Even if that's true, I'm not sure what workflow you have in mind. Someone mentioned the possibility that Emacs could propose using some mode when user visits a file, AFAIR. So the workflow would be to ask the user whether she wants to turn on mode FOO in files like this one, and if the answer is YES, modify auto-mode-alist accordingly. > My > goal here is to fix the problem of ts modes installing themselves into > auto-mode-alist (and major-mode-remap-defaults) haphazardly, with > associated problems like https://debbugs.gnu.org/74339#38, for example. We all want to find a better solution, the challenge is to find one. > If editing regexp directly is a difficulty, we could either add some > helpers in the Customize interface, or a command which would prompt for > mode, for file extension(s), and then customize auto-mode-alist based on > that. The latter is the idea I had in mind. > But that's not specific to tree-sitter modes No, but that shouldn't prevent us from implementing something specific to tree-sitter modes for starters. > and not a replacement for the current setup. What current setup? > > And I > > thought this discussion at some point mentioned that Emacs should > > suggest a mode for the file being visited? in which case specifying > > the file is trivial. > > Philip K. has proposed a package package-autosuggest - which is > something that approaches similar needs from an opposite direction > (providing automatic suggestions when the user visit a file which is > currently not supported but could be after installing a package or doing > some extra customization). A totally valid approach - and well-tested by > the likes of VS Code. > > I haven't tested that branch myself yet, and it seems to come with a > bunch of UI decisions, so it's a bigger endeavor. We could start from something specific to tree-sitter modes, and merge these two features later.