emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Update on tree-sitter structure navigation


From: Ihor Radchenko
Subject: Re: Update on tree-sitter structure navigation
Date: Fri, 08 Sep 2023 12:03:58 +0000

Eli Zaretskii <eliz@gnu.org> writes:

>> > Unifying tree-sitter and non-tree-sitter modes creates many problems. I’m 
>> > rather thinking about some way to share some configuration between two 
>> > modes. We’ve had many discussions before with no fruitful conclusion.
>> 
>> Any chance you have links to these discussions?
>
> Here's one:
>
>   https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg01251.html
>   https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg01293.html

Thanks!

According to the discussion, the main problem is that interleaving
ts-related and ts-unrelated code in the same mode is risky. It is safer
to have a dedicated foo-ts-mode rather than modifying the existing
foo-mode.

However, separate *-ts- and *- modes create a problem when user config
tailored for old, non-ts mode will no longer work. For example,
c-ts-mode has `c-ts-mode-indent-offset', while cc-mode has
c-basic-offset in `c-style-alist'.

Ideally, user-facing API should be shared between the modes: defcustoms,
faces, and certain high-level functions like `c-set-style'.

One might slowly:
1. Add support of foo-mode's defcustoms to foo-ts-mode, when applicable
2. Create a shared API between foo-mode and foo-ts-mode that will call
   the appropriate implementation depending on which mode is active.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]