summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorYuan Fu <casouri@gmail.com>2023-01-08 19:05:19 -0800
committerYuan Fu <casouri@gmail.com>2023-01-08 21:22:06 -0800
commitef87c75566018b546e56f64f66f665ebfd8da305 (patch)
tree97626b79212932d503077e5d7c9d73c3d0b6ec1e /lisp/emacs-lisp/comp.el
parent1238fa8e49bdb12db66d856dcb4b192db5d026ff (diff)
downloademacs-ef87c75566018b546e56f64f66f665ebfd8da305.tar.gz
emacs-ef87c75566018b546e56f64f66f665ebfd8da305.tar.bz2
emacs-ef87c75566018b546e56f64f66f665ebfd8da305.zip
Make sure NODE is not the root node in tree-sitter indent (bug#60602)
There are two possible ways to solve the problem raised in the bug report: either make sure NODE is never the root (so that parent is never nil), or allow parent to be nil. If we go with the latter, a lot of matcher and anchor functions need change (they need to guard against a null parent). I tried it, and needing to check for null parent is pretty annoying. In comparison, if NODE is never the root, it is very convenient for the user, and it doesn't complicate the rule that much (and it's rather intuitive, people usually don't think of the case where NODE is the root node). So that's what I choose. * doc/lispref/modes.texi (Parser-based Indentation): Update manual. * lisp/treesit.el (treesit-indent-function): Update docstring. (treesit--indent-1): Make sure NODE is not the root.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
0 files changed, 0 insertions, 0 deletions