From: Yuan Fu <casouri@gmail.com>
To: Theodor Thornhill <theo@thornhill.no>
Cc: emacs-devel <emacs-devel@gnu.org>,
Mickey Petersen <mickey@masteringemacs.org>,
Dmitry Gutov <dgutov@yandex.ru>
Subject: Re: Extending define-derived-mode
Date: Wed, 31 May 2023 13:35:05 -0700 [thread overview]
Message-ID: <AC0028A8-226E-4805-8C69-EB888B7A0F7F@gmail.com> (raw)
In-Reply-To: <E2F8AA1F-F219-4B51-8017-2B508A077C9E@thornhill.no>
> On May 29, 2023, at 10:51 PM, Theodor Thornhill <theo@thornhill.no> wrote:
>
>
>
> On 30 May 2023 07:16:49 CEST, Yuan Fu <casouri@gmail.com> 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’d like
>> to discuss the things we need and how can we address them.
>
> Thanks for bringing this up!
>
> I'll quickly just add one more thing, and respond more thoroughly in a different 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.
>
> We can supply some DSL with preconfigured settings, and add extensible functionalities.
>
> Maybe something like:
>
> (define-layer 'javascript-mode
> :mode 'treesit
> :enabled-in '(".js", ".mjs")
> :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 implementation owns the namespace"-problem.
Yeah this look interesting. From your example it looks more like a configuration oriented, like a more integrated use-package. I feel like we should solve the "the first language mode implementation owns the namespace”-problem in a more direct and standalone way.
Yuan
next prev parent reply other threads:[~2023-05-31 20:35 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-30 5:16 Extending define-derived-mode Yuan Fu
2023-05-30 5:51 ` Theodor Thornhill
2023-05-31 20:35 ` Yuan Fu [this message]
2023-06-01 5:43 ` Theodor Thornhill
2023-05-30 10:48 ` Eli Zaretskii
2023-05-30 14:16 ` Stefan Monnier
2023-05-31 21:31 ` Yuan Fu
2023-06-01 4:06 ` Stefan Monnier
2023-06-01 6:39 ` Eli Zaretskii
2023-06-02 7:50 ` Yuan Fu
2023-06-02 11:54 ` Eli Zaretskii
2023-06-05 7:31 ` Yuan Fu
2023-06-05 11:33 ` Eli Zaretskii
2023-06-08 7:25 ` Yuan Fu
2023-06-02 7:44 ` Yuan Fu
2023-06-02 16:46 ` Stefan Monnier
2023-06-05 7:39 ` Yuan Fu
2023-06-05 15:17 ` Stefan Monnier
2023-05-31 20:48 ` Yuan Fu
2023-06-01 5:47 ` Eli Zaretskii
2023-06-02 7:45 ` Yuan Fu
2023-06-02 11:51 ` Eli Zaretskii
2023-05-30 17:24 ` Juri Linkov
2023-06-05 8:30 ` Philip Kaludercic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AC0028A8-226E-4805-8C69-EB888B7A0F7F@gmail.com \
--to=casouri@gmail.com \
--cc=dgutov@yandex.ru \
--cc=emacs-devel@gnu.org \
--cc=mickey@masteringemacs.org \
--cc=theo@thornhill.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.