From: Yuan Fu <casouri@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
emacs-devel <emacs-devel@gnu.org>,
Mickey Petersen <mickey@masteringemacs.org>,
Theodor Thornhill <theo@thornhill.no>,
dgutov@yandex.ru
Subject: Re: Extending define-derived-mode
Date: Thu, 8 Jun 2023 00:25:53 -0700 [thread overview]
Message-ID: <9DAD00FE-8147-471E-95B1-5AEF0865D2C3@gmail.com> (raw)
In-Reply-To: <83sfb6400h.fsf@gnu.org>
> On Jun 5, 2023, at 4:33 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Mon, 5 Jun 2023 00:31:02 -0700
>> Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
>> emacs-devel <emacs-devel@gnu.org>,
>> Mickey Petersen <mickey@masteringemacs.org>,
>> Theodor Thornhill <theo@thornhill.no>,
>> dgutov@yandex.ru
>>
>>> For users to be able to share stuff like electric-quote-local-mode
>>> we'd need to rewrite those supporting modes to allow that. When one
>>> of the two modes uses regexps and syntax tables, whereas the other
>>> uses treesit-based parsers, this is not a trivial task. I invite you
>>> to audit the various electric modes we have and see how many of them
>>> can be shared with minimum effort between non-TS and TS modes.
>>
>> I’m talking about sharing the sharable config. Electric modes already work the same in ts and non-ts modes: electric-pair-mode and electric-quote-mode inserts matching pairs and quotes and aren’t affected by tree-sitter, electric-indent-mode uses the standard indent-line-function which both ts and non-ts modes confront to. Is there any other electric modes?
>
> For one prominent example, see the node "Electric Keys" in the CC Mode
> manual, and the minor modes described in "Minor Modes" there.
Ok, but they are CC mode’s features, not Emacs-wide features like electric-quote/pair/indent-mode.
>
>> Also, ts modes generally have the same syntax table as non-ts modes. So if some package uses the syntax table they are largely not affected either.
>
> But it makes little sense to me to have part of a mode use our syntax
> tables, and another part use the results of parsing the code by a
> parser library. I can guarantee inconsistencies.
Not really used by the mode itself, but some generic third-party package. Having correct information in the syntax table is better than not. Also some ts modes enhances the syntax table information, making it more accurate, by adding appropriate syntax-table text property on some chars, like the angle brackets in C++ and Rust.
Yuan
next prev parent reply other threads:[~2023-06-08 7:25 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
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 [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9DAD00FE-8147-471E-95B1-5AEF0865D2C3@gmail.com \
--to=casouri@gmail.com \
--cc=dgutov@yandex.ru \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=mickey@masteringemacs.org \
--cc=monnier@iro.umontreal.ca \
--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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).