Files
emacs/lisp
Yuan Fu f63bcf2dfe Fix treesit--indent-1 regarding local parsers
Take this code as an example:

1 class Foo
2 {
3     /**
4      * Block comment
5      */
6     function foo($c) {
7     }
8 }

Suppose the block comment is covered by a local parser.  When we
indent line 3, treesit--indent-1 will try to get the local parser at
the BOL, and it'll get the local parser.  But it shouldn't use the
local parser to indent this line, it should use the host parser of
that local parser instead.

So now, if treesit--indent-1 gets a local parser, but the local
parser's root node's start coincides with BOL, treesit--indent-1 will
use the host parser to indent this line.

We also need to make treesit--update-ranges-local to save the host
parser along with the local parser, and make
treesit-local-parsers-at/on extract and return the host parser.

I also switch the two cases in the cond form in treesit--indent-1:
(null (treesit-parser-list)) and (car local-parsers), (car
local-parsers) now takes precedence.

* lisp/treesit.el (treesit-local-parsers-at):
(treesit-local-parsers-on): Add WITH-HOST parameter.
(treesit--update-ranges-local): Save the host parser to the local
overlay.
(treesit--indent-1): If the root node of the local parser is at BOL,
use the host parser instead.
2024-01-30 22:28:47 -08:00
..
2024-01-02 10:28:14 +08:00
2024-01-30 17:23:25 -08:00
2024-01-24 20:58:32 -08:00
2024-01-29 17:33:35 -08:00
2024-01-27 20:44:01 +02:00
2024-01-02 10:28:14 +08:00
2024-01-29 00:22:37 -08:00
2024-01-27 08:13:22 -05:00
2024-01-29 00:22:37 -08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 15:28:06 +01:00
2024-01-30 17:23:25 -08:00
2024-01-21 15:28:06 +01:00
2024-01-13 05:36:15 -05:00
2024-01-20 06:25:59 -05:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-13 05:36:16 -05:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 15:28:06 +01:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 15:28:06 +01:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-06 08:20:19 -05:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:30:05 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-27 12:18:17 +02:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-21 15:28:06 +01:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-27 08:14:31 -05:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-20 06:25:59 -05:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-21 15:28:06 +01:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-20 06:25:59 -05:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00
2024-01-02 09:47:10 +08:00
2024-01-02 10:28:14 +08:00

This directory contains source code for the parts of Emacs that are
written in Emacs Lisp.  *.el files are Emacs Lisp source, and the
corresponding *.elc files are byte-compiled versions.  Byte-compiled
files are architecture-independent.

The term subdirectory contains Lisp files that customize Emacs for
certain terminal types.  When Emacs starts, it checks the TERM
environment variable to get the terminal type and loads
'term/${TERM}.el' if it exists.

The other subdirectories hold Lisp packages grouped by their general
purpose.