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: Tue, 17 Jan 2023 19:58:40 +0200 Message-ID: <83fsc92gbz.fsf@gnu.org> References: <84973.1672843723@hassadar.pretzelnet.org> <83wn62xi3k.fsf@gnu.org> <83o7rexe2n.fsf@gnu.org> <83h6x5xym7.fsf@gnu.org> <83h6wr6gmz.fsf@gnu.org> <868ri140sr.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3482"; 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: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 17 18:59:20 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 1pHqEy-0000dN-Cu for ged-emacs-devel@m.gmane-mx.org; Tue, 17 Jan 2023 18:59:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHqET-0000sz-3h; Tue, 17 Jan 2023 12:58:49 -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 1pHqEI-0000kF-5w for emacs-devel@gnu.org; Tue, 17 Jan 2023 12:58:39 -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 1pHqEG-0006rI-DM; Tue, 17 Jan 2023 12:58:36 -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=uGogkOgDvYbNnyOnuCgfOg+mxEP5IAHIxpKFM/lpB+M=; b=kb27FjbUanl1 ejx8HO5empreM0tybWSypkGgSfGNFIZYs7hBbERfyg1Rvkx+xkd+JRn/mrxpu64qh9z7vDHXZwQ4o VS3BEF/IiIaq+p2CIv5zqsIozKtR8UPRkbXMuXFAnkrH/qeJ8d8aUJ5YJsgX/Gc8ZolEWkZ1155Dg c8YA4tiord2UNSz7bHCpStZoevGWFQNRHZfag4zS/HKrGgxDD6FLd+0OSJtMPb22SxFmGupFwdQcT QPy+l4RiHeMMaJ0dUyUu+YTiZ6n7f6X0c5yO43h7vS0fizzcmfi7jUfAew1sgNYB475ivxYb/ztYw daXQ2moVlvof21LBliDL0A==; 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 1pHqED-0002Nu-Hn; Tue, 17 Jan 2023 12:58:36 -0500 In-Reply-To: <868ri140sr.fsf@mail.linkov.net> (message from Juri Linkov on Tue, 17 Jan 2023 19:30:16 +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:302489 Archived-At: > From: Juri Linkov > Cc: casouri@gmail.com, monnier@iro.umontreal.ca, larsi@gnus.org, > theo@thornhill.no, jostein@secure.kjonigsen.net, emacs-devel@gnu.org > Date: Tue, 17 Jan 2023 19:30:16 +0200 > > It fails for many scenarios: > > 1. The user needs to use e.g. js-ts-mode. Your patch requires that > users first visit a js file in js-mode, then they need to type > > M-x js-ts-mode RET > > then for the rest of the session they can use js-ts-mode. > But for a new session they need to repeat the same again. Or customize auto-mode-alist. This is a consequence of the fact that js-ts-mode doesn't have a separate .el file. If you have better ideas for that, I'm all ears. > 2. For other ts modes adding something like (require 'c-ts-mode) > to the user's init file is not a clean way to enable such modes. Why not? > Also takes additional space even when users don't intend to use them > in the current session, thus negating the benefits of autoloading. Once again, if the above is somehow too annoying, they can customize auto-mode-alist manually. Or even use use-package (and have full benefit of autoloading). In any case, the fact that a mode is loaded and not used is not a problem large enough to reject this simple arrangement. Moreover, if someone puts the require into their init file, they probably want to use the mode quite a lot, so it will not remain ballast for too long. > 3. There is no simple way to disable a ts mode after loading > the corresponding ts file. Yes, there is: restart the session. IMO, adequate enough for something you want to try, and then find not to like. Bottom line: if you have better, simpler solutions, please tell. The ones you proposed until now are significantly more complex, and it is not reasonable to ask users to go to such lengths to try a new mode. But of course, if someone wants to do it in a more complex and more flexible way, they still can.