From: Eli Zaretskii Date: Mon, 2 Dec 2024 12:11:00 +0000 (+0200) Subject: ; Fix recently-updated documentation X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=568affd080c98b07e42cfcdd954d984eff446b91;p=emacs.git ; Fix recently-updated documentation * doc/lispref/modes.texi (Parser-based Indentation): Fix markup, typos and wording. (cherry picked from commit a79c300a88b195572e57c79fa5b23cdf0e3460d5) --- diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 5ef3de665d9..34dcf4cb10e 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -5209,11 +5209,12 @@ more complex indentation engines. @defvar treesit-simple-indent-rules This local variable stores indentation rules for every language. It is an list of elements of the form @w{@code{(@var{language} -@var{rule}...)}}, where @var{language} is a language symbol, and each +@var{rule}@dots{})}}, where @var{language} is a language symbol, and each @var{rule} is either a list with elements of the form -@w{@code{(@var{matcher} @var{anchor} @var{offset})}}, or a function. Let -'s focus on the list variant first, we'll come back to the function -variant later. +@w{@code{(@var{matcher} @var{anchor} @var{offset})}}, or a function. + +Here's the description of the list variant, followed by the function +variant. First, Emacs passes the smallest tree-sitter node at the beginning of the current line to @var{matcher}; if it returns non-@code{nil}, this @@ -5244,14 +5245,13 @@ or a function that returns an integer. If it is a function, it is passed @var{node}, @var{parent}, and @var{bol}, like matchers and anchors. -Remember that @var{rule} can also be a function. This is for the -complex cases where a rule needs to consider the matching rule and -anchor together. If @var{rule} is a function, it's passed the same -argument as @var{matcher}: @var{node}, @var{parent}, and @var{bol}. If -it matches, @var{rule} should return a cons @w{@code{(@var{anchor-pos} -. @var{offset})}}, where @var{anchor-pos} is a buffer position, and -@var{offset} is the indent offset. If @var{rule} does't match, it -should return @code{nil}. +If @var{rule}is a function, it is useful for the complex cases where a +rule needs to consider the matching rule and the anchor together. The +@var{rule} function is passed the same argument as @var{matcher}: +@var{node}, @var{parent}, and @var{bol}. If it matches, @var{rule} +should return a cons @w{@code{(@var{anchor-pos} . @var{offset})}}, where +@var{anchor-pos} is a buffer position, and @var{offset} is the indent +offset. If @var{rule} doesn't match, it should return @code{nil}. @end defvar @defvar treesit-simple-indent-presets