emacs-devel
[Top][All Lists]
Advanced

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

Re: Comments to the new tree sitter implementation


From: Stefan Monnier
Subject: Re: Comments to the new tree sitter implementation
Date: Sun, 24 Apr 2022 16:27:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> the example I provided.  But for the case where what you want is to find
> the first parent, then move to beginning of indentation, I guess it's
> fine?

What I mean is that When this rule gives the right answer it's just by
lucky accident (usually because of other conventions that the writer
follows which causes the desired "anchor point" to be the node that's at
the beginning of the line).

A good indentation rule should try not to depend so arbitrarily on where
line-feeds were inserted in the code.  This is more important for code
that's not (fully) written by humans.  As a concrete example, the
auto-fill-mode support in SMIE behaves worse with such rules (because it
works by trying to insert a line-feed at different places on the line
and choose the spot that most reduced indentation, and the above rule
would lead to choosing poor places to insert the line-feeds because it
basically assumes that the line-feeds were placed with care).


        Stefan




reply via email to

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