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: Thu, 16 Feb 2023 10:34:27 +0200 Message-ID: <83bklu80vg.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34570"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dgutov@yandex.ru, 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: Theodor Thornhill Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 16 09:35:27 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 1pSZjj-0008k6-5u for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Feb 2023 09:35:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSZj7-00043f-Ja; Thu, 16 Feb 2023 03:34: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 1pSZj5-00043F-6B for emacs-devel@gnu.org; Thu, 16 Feb 2023 03:34:47 -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 1pSZj3-0003ow-Ah; Thu, 16 Feb 2023 03:34:45 -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=Mmn7yLXwxKOUO00rlOfEv9fAewYeF/WitqKvFJ3dukw=; b=buTEZTXFMtt3 T0Ih9HghWJ+JXPss8aG9HoP5uF3j33JEOuCghyE/IahRPOXbgk8t96yHhwNhXuRdhGRqfyNCKjDzF DFmq9NHXUtABjJSkNnZrC7p0VB6O5FKF/HsP725GJaciGMGCRn1CnGFmUpczHneBi4hMEUuDvR2vZ F6n5Jf5uJveNNrirCDMJwA31RDnKmE6tKsGoZA11A22VUBa/A5Edw8O0lzDtXcKot9PVm4GA4yzfK 8EYpEiUlDjUAhBngN/Ozfg4n9Ctz3bc7YnbMYUKVFBQNNOjPF970MzEdb5lSvKYB8ltuliVjohUv3 n9rM9KHgwbkF1byuU81cOg==; 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 1pSZj2-0004z0-JR; Thu, 16 Feb 2023 03:34:44 -0500 In-Reply-To: (message from Theodor Thornhill on Thu, 16 Feb 2023 08:53:56 +0100) 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:303381 Archived-At: > Date: Thu, 16 Feb 2023 08:53:56 +0100 > From: Theodor Thornhill > 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 > > I'm thinking some devise like a "language layer", where major and minor modes are pluggable. > > Let's say you want to program in JavaScript. > > Then you can for example do something like: > > (make-language-layer 'js-layer > :major-mode 'js-ts-mode > :lsp 'eglot > :dagnostics 'flymake) > > > Then > > (add-to-list auto-mode-alist ".js" 'js-layer) > > And so forth. In this case a person can swap out flymake for flycheck, eglot for lsp-mode, js-ts-mode for js-mode etc. Then no implementation "owns" the language namespace, and we hopefully don't step on anyone's toes. > > What do you think? I don't know yet. We should definitely think about this more. Emacs never had more than a single major mode per programming language, so for us "language" and "major mode" were always synonyms. (Perl mode and CPerl mode is the only exception I know of, and it did cause us grief.) So yes, this is a new situation that could call for some new concepts in Emacs.