diff options
author | Gerd Möllmann <gerd@gnu.org> | 2022-12-19 14:25:27 +0100 |
---|---|---|
committer | Gerd Möllmann <gerd@gnu.org> | 2022-12-19 14:25:27 +0100 |
commit | 54ec3973e298c3d2b3d81484f80053d881694f88 (patch) | |
tree | e2eddc55211ff04e9e6e76e34f56cdccb3123253 /doc/lispref/parsing.texi | |
parent | b182f1801762087bd7fe6d16c21dc6bb272d4a3f (diff) | |
parent | cb242bf1514ade34ab93b1db1ea7550093ae5839 (diff) | |
download | emacs-54ec3973e298c3d2b3d81484f80053d881694f88.tar.gz |
Merge remote-tracking branch 'origin/master' into scratch/pkg
Diffstat (limited to 'doc/lispref/parsing.texi')
-rw-r--r-- | doc/lispref/parsing.texi | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index 3223875320a..adb4c5e6e0c 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi @@ -409,6 +409,13 @@ Create a parser for the specified @var{buffer} and @var{language} By default, this function reuses a parser if one already exists for @var{language} in @var{buffer}, but if @var{no-reuse} is non-@code{nil}, this function always creates a new parser. + +If that buffer is an indirect buffer, its base buffer is used instead. +That is, indirect buffers use their base buffer's parsers. If the +base buffer is narrowed, an indirect buffer might not be able to +retrieve information of the portion of the buffer text that are +invisible in the base buffer. Lisp programs should widen as necessary +should they want to use a parser in an indirect buffer. @end defun Given a parser, we can query information about it. @@ -447,7 +454,8 @@ tree incrementally. @defun treesit-parser-list &optional buffer This function returns the parser list of @var{buffer}. If @var{buffer} is @code{nil} or omitted, it defaults to the current -buffer. +buffer. If that buffer is an indirect buffer, its base buffer is used +instead. That is, indirect buffers use their base buffer's parsers. @end defun @defun treesit-parser-delete parser @@ -1727,20 +1735,6 @@ For more information of these built-in tree-sitter features, For supporting mixing of multiple languages in a major mode, @pxref{Multiple Languages}. -Setting the following local variables allows tree-sitter's indentation -engine to correctly indent multi-line comments: - -@defvar treesit-comment-start -This should be a regular expression matching an opening comment token. -For example, it should match @samp{//}, @samp{////}, @samp{/*}, -@samp{/****}, etc., in C. -@end defvar - -@defvar treesit-comment-end -This should be a regular expression matching a closing comment token. -For example, it should match @samp{*/}, @samp{****/}, etc., in C. -@end defvar - @node Tree-sitter C API @section Tree-sitter C API Correspondence |