From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: Make all tree-sitter modes optional Date: Thu, 16 Feb 2023 15:48:24 +0100 Message-ID: <87lekxr7if.fsf@thornhill.no> References: <83o7rexe2n.fsf@gnu.org> <83h6x5xym7.fsf@gnu.org> <83h6wr6gmz.fsf@gnu.org> <868ri140sr.fsf@mail.linkov.net> <83fsc92gbz.fsf@gnu.org> <83cz6ccagy.fsf@gnu.org> <838rgzaqmj.fsf@gnu.org> <7bad77ae-a176-d49b-5115-dbadf7e6d1bc@yandex.ru> <3112fa15-8d1c-679a-f319-cf659b097be4@yandex.ru> <831qmq9jjr.fsf@gnu.org> <9319d220-dd73-1873-096d-5797410677f6@yandex.ru> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32560"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, acm@muc.de, juri@linkov.net, casouri@gmail.com, larsi@gnus.org, jostein@secure.kjonigsen.net, emacs-devel@gnu.org To: Dmitry Gutov , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 16 15:49:23 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 1pSfZb-0008HA-Bm for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Feb 2023 15:49:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSfYm-0007UN-3H; Thu, 16 Feb 2023 09:48:32 -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 1pSfYk-0007U8-UD for emacs-devel@gnu.org; Thu, 16 Feb 2023 09:48:30 -0500 Original-Received: from out-176.mta0.migadu.com ([2001:41d0:1004:224b::b0]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSfYj-0003ZK-Ad for emacs-devel@gnu.org; Thu, 16 Feb 2023 09:48:30 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: <9319d220-dd73-1873-096d-5797410677f6@yandex.ru> Received-SPF: pass client-ip=2001:41d0:1004:224b::b0; envelope-from=theo@thornhill.no; helo=out-176.mta0.migadu.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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:303416 Archived-At: Dmitry Gutov writes: > On 16/02/2023 09:53, Theodor Thornhill wrote: >> To me the last point here is the important one. We kinda "rushed" the modes in so that the treesit backend would have anything to show for in emacs-29. We've tried many times to devise a mechanism for it to be unintrusive, and definitely so for the cc mode equivalents. Yes they are far behind them in some respects, so there was never a point to make them the default for the foreseeable future. > > Nobody is arguing about whether the modes should be default at the moment. > >> (make-language-layer 'js-layer >> :major-mode 'js-ts-mode >> :lsp 'eglot >> :dagnostics 'flymake) > > If we do something like that, I'd rather we try for a scheme where we > don't need to enumerate the "swappable" features in advance -- aside > from the major mode, of course. But Eglot and friends plug into a > language through indirection. > > Other than that, the user still needs to 'M-x eglot' or 'M-x lsp', or > enable global-flycheck-mode, so the declarations like above seem redundant. > > To clarify, the example above looks nice, but there are a lot more > programming related minor modes than the LSP clients and Flymake/Flycheck. Yeah, absolutely. This was just an example written on my phone in a hurry. My point is simply that from a users perspective you'd want the whole "ide" experience many times, but not necessarily always, and some construct like this would allow for that. In addition, a user opening a project in a language never used before may be pleasantly surprised to see diagnostics, autocomplete etc without setup, at least after an optional "enable language layer for Rust? [yn]" or something like that. and sure, there are many things that should be added, :completions, :project etc, where settings could be company, corfu, project could be project.el or projectile and so forth. And obviously some :finally that runs an arbitrary form of sorts. Maybe? Theo