From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: Extending define-derived-mode Date: Tue, 30 May 2023 07:51:14 +0200 Message-ID: References: <20F07C52-6B39-4B24-8433-82E2226EADA6@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19500"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mickey Petersen , Dmitry Gutov To: Yuan Fu , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 30 07:52:21 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 1q3sHN-0004p6-2x for ged-emacs-devel@m.gmane-mx.org; Tue, 30 May 2023 07:52:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3sGc-0001F2-H6; Tue, 30 May 2023 01:51:34 -0400 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 1q3sGW-0001CG-AO for emacs-devel@gnu.org; Tue, 30 May 2023 01:51:28 -0400 Original-Received: from out-35.mta0.migadu.com ([2001:41d0:1004:224b::23]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3sGT-0000UK-R5 for emacs-devel@gnu.org; Tue, 30 May 2023 01:51:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1685425879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ggutmta/H074k7VvaeH173oR5ET1a9UVfb8Efx6yG+A=; b=r4wT4nU6VuCs1WtNhdiI/H+kpaaLbKwW8eKjv8jmlV/SBeKD6p+iwHZ/TwA8Mc5OizQWor 7l/5B81iy5pMhjeC73bZbekAnwBHRuemYRzQNDM9XRQiRlbK1qPcQPSsRl8kaRHeVtM5tT gMzn6QPvE6eHrNDkbc3swldRUYYoIYgpz9dWcm0rMuKcD+ddk/3uSmq/NDP6R2WO5d5eN8 R8KlB9tu1PG/7oxqfzvtAGLRtRHwjbNJarZIzFAHBJQHYxKyybvUrraxdHWOr9P3UzXYVH JrbsleTtkE3LLI+GcCQRe4Vd9ZkppkagJuE/sdeoKZsxJ15xqlUYpCv6Bp23rQ== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: <20F07C52-6B39-4B24-8433-82E2226EADA6@gmail.com> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:1004:224b::23; envelope-from=theo@thornhill.no; helo=out-35.mta0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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:306402 Archived-At: On 30 May 2023 07:16:49 CEST, Yuan Fu wrote: >When we were adding tree-sitter modes a couple of month ago, it was >clear that the current major mode model needs some upgrade, I=E2=80=99d l= ike >to discuss the things we need and how can we address them=2E Thanks for bringing this up! I'll quickly just add one more thing, and respond more thoroughly in a dif= ferent mail: Maybe we can consider another abstraction to cover the following: - configure what set of modes to use for a given language - set choice of diagnostic tool (flymake/flycheck etc) - set LSP client implementation with config to use - project based configs - separate mode name and implementation I posted some time ago a simple idea covering this, and maybe the time is = now to revisit this idea? People seem to like doom Emacs/spacemacs etc, so = their idea of "layers" may be a nice route to consider=2E We can supply some DSL with preconfigured settings, and add extensible fun= ctionalities=2E Maybe something like: (define-layer 'javascript-mode :mode 'treesit :enabled-in '("=2Ejs", "=2Emjs") :diagnostic-backend 'flymake :lsp-client 'lsp-mode ;; default is 'eglot :project '(:root-function #'some-rootfinder-fn) :other-stuff '(eslint json-something nvm)) This may seem only tangentially related to your email, but I believe it is= , in that mode inheritance touches the "the first language mode implementat= ion owns the namespace"-problem=2E =20 WDYT? Theo