diff options
| author | Yuan Fu | 2022-10-31 15:11:44 -0700 |
|---|---|---|
| committer | Yuan Fu | 2022-10-31 15:35:52 -0700 |
| commit | 4ef50ccd3f8bc177ef6dd7183a9268bb8057f064 (patch) | |
| tree | 945508a2e5ea4c2d0ef0e2f24c51ddb74f4eef0d | |
| parent | b49250ada978c7b21cb93177c874c81a27fa4fec (diff) | |
| download | emacs-4ef50ccd3f8bc177ef6dd7183a9268bb8057f064.tar.gz emacs-4ef50ccd3f8bc177ef6dd7183a9268bb8057f064.zip | |
; Explain the BEG and END argument in treesit-query-capture better
* doc/lispref/parsing.texi (Pattern Matching): Update manual.
* src/treesit.c (Ftreesit_query_capture): Update docstring.
| -rw-r--r-- | doc/lispref/parsing.texi | 4 | ||||
| -rw-r--r-- | src/treesit.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index 524b81a2bbd..7164baaa6d2 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi | |||
| @@ -992,7 +992,9 @@ The function returns all the captured nodes in a list of the form | |||
| 992 | non-@code{nil}, it returns the list of nodes instead. By default the | 992 | non-@code{nil}, it returns the list of nodes instead. By default the |
| 993 | entire text of @var{node} is searched, but if @var{beg} and @var{end} | 993 | entire text of @var{node} is searched, but if @var{beg} and @var{end} |
| 994 | are both non-@code{nil}, they specify the region of buffer text where | 994 | are both non-@code{nil}, they specify the region of buffer text where |
| 995 | this function should match nodes. | 995 | this function should match nodes. Any matching node whose span |
| 996 | overlaps with the region between @var{beg} and @var{end} are captured, | ||
| 997 | it doesn't have to be completely in the region. | ||
| 996 | 998 | ||
| 997 | @vindex treesit-query-error | 999 | @vindex treesit-query-error |
| 998 | @findex treesit-query-validate | 1000 | @findex treesit-query-validate |
diff --git a/src/treesit.c b/src/treesit.c index e4be065d94a..9324b8b1006 100644 --- a/src/treesit.c +++ b/src/treesit.c | |||
| @@ -2178,8 +2178,10 @@ either string or sexp form. When using repeatedly, a compiled query | |||
| 2178 | is much faster than a string or sexp one, so it is recommend to | 2178 | is much faster than a string or sexp one, so it is recommend to |
| 2179 | compile your query if it will be used repeatedly. | 2179 | compile your query if it will be used repeatedly. |
| 2180 | 2180 | ||
| 2181 | BEG and END, if both non-nil, specify the region of buffer positions | 2181 | BEG and END, if both non-nil, specify the region of buffer positions |
| 2182 | in which the query is executed. | 2182 | in which the query is executed. Any matching node whose span overlaps |
| 2183 | with the region between BEG and END are captured, it doesn't have to | ||
| 2184 | be completely in the region. | ||
| 2183 | 2185 | ||
| 2184 | If NODE-ONLY is non-nil, return a list of nodes. | 2186 | If NODE-ONLY is non-nil, return a list of nodes. |
| 2185 | 2187 | ||