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: Tree-sitter maturity Date: Sun, 29 Dec 2024 09:26:37 +0200 Message-ID: <86frm7q79u.fsf@gnu.org> References: <1ed88fca-788a-fe9f-b6c8-edb2f49751c9@mavit.org.uk> <67428b3d.c80a0220.2f3036.adbdSMTPIN_ADDED_BROKEN@mx.google.com> <86ldwdm7xg.fsf@gnu.org> <6765355b.c80a0220.1a6b24.3117SMTPIN_ADDED_BROKEN@mx.google.com> <00554790-CACA-4233-8846-9E091CF1F7AA@gmail.com> <86msgl2red.fsf@gnu.org> <87o710sr7y.fsf@debian-hx90.lan> <8734i9tmze.fsf@posteo.net> <86plldwb7w.fsf@gnu.org> <87ttapryxr.fsf@posteo.net> <0883EB00-3BB2-4BC8-95D1-45F4497C0526@dancol.org> <87plldrx6a.fsf@posteo.net> <87ikr5rwx0.fsf@posteo.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39350"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, emacs-devel@gnu.org, manphiz@gmail.com, Alan Mackenzie To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 29 08:34:53 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 1tRnp6-000A52-Vw for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Dec 2024 08:34:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhP-0006XV-6y; Sun, 29 Dec 2024 02:26:55 -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 1tRnhM-0006Wj-IQ for emacs-devel@gnu.org; Sun, 29 Dec 2024 02:26:52 -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 1tRnhL-00029F-37; Sun, 29 Dec 2024 02:26:51 -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=XBaLba3E8HVQw7rNwTcb0stcqBOA3dZjSqQKtdPsnWs=; b=LGNWJ7Ob6T/3 +zlZRJyVagOeNmLyTPlnPXKgGvFpScRM42ylGwG+AMR6npZ1L+9ciiYtRHUDN2tr1yu26dGne8o5V 3aCC6OBQm3r0136yS9bYGmDq4SZzWrJMLtuNP/3BMftG76mG93prNFpnzG0JyCUp3oDvFQT+b1Myk sozP7IcXOBThhpGx+HmpLduXhluOJgqpnJ2bdQ3B9MIKqwDPiay/m+KVkq8UbVEJWbFCZXas3oBDq +2PfU9ieXhIO8oFIJifhj/l6DFTDle9dPL56s9PB4zfIuebU/UvoSB3Jk2qasygMNA/P2XVqUpMy/ 7wmXNt+OQMjmHq1GIw29hA==; In-Reply-To: (message from Richard Stallman on Sat, 28 Dec 2024 23:19:45 -0500) 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:327318 Archived-At: > From: Richard Stallman > Cc: emacs-devel@gnu.org, manphiz@gmail.com > Date: Sat, 28 Dec 2024 23:19:45 -0500 > > > Oh, and another point I have been reminded of while writing this: The > > recent addition of more and more -ts-modes without "regular" -modes has > > been slightly concerning. While I understand that re-implementing a > > "lua-mode" or "php-mode" from scratch is not an effort one wants to > > impose on anymore, > > This is not clean, and might be a real problem. What should happen > when someone who does not use tree-sitter visits a Lua file or a PHP > file? What happens in those cases now? Nothing happens. These modes are currently all optional, so the users currently must load the mode manually (or in their init files) to have auto-mode-alist modified to affect visiting the corresponding files. For example, lua-ts-mode.el has this at top-level: (when (treesit-ready-p 'lua) (add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-ts-mode)) (add-to-list 'interpreter-mode-alist '("\\ In general, Emacs should not have a FOO-ts-mode without a correspnding > FOO-mode. I disagree. I don't object having non-ts modes, of course, but see no reason to mandate such modes when a tree-sitter-based mode exists. We made those modes optional as above for that very reason: to make sure they are activated only if the user says so and only if the necessary prerequisites are fulfilled. > Otherwise users will get surprised. We made those modes optional to avoid surprising users. > It might be simple to modify lua-ts-mode so that it can be directed to > disable tree-sitter, perhaps by a global variable -- and then define > lua-mode to call lua-ts-mode after specifying that. The last part was exactly what prompted Alan Mackenzie to resign. It sounds like you now agree with what the rest of us think: that interpreting lua-mode as meaning invoke lua-ts-mode is fine?