the parent that satisfies @var{predicate}. @var{predicate} can be
either a function that takes a node as argument and returns @code{t}
or @code{nil}, or a regexp matching node type names, or other valid
-predicates described in @var{treesit-thing-settings}. If no parent
+predicates described in @code{treesit-thing-settings}. If no parent
satisfies @var{predicates}, this function returns @code{nil}.
Normally this function only looks at the parents of @var{node} but not
feature of tree-sitter, and comparatively less powerful, but more
suitable for navigation and traversing the parse tree.
-You can define things with @var{treesit-thing-settings}.
+You can define things with @code{treesit-thing-settings}.
@defvar treesit-thing-settings
This is an alist of thing definitions for each language. The key of
that's either a @code{sexp} thing or a @code{sentence} thing, as defined
by some other rule in the alist.
-Here's an example @var{treesit-thing-settings} for C and C++:
+Here's an example @code{treesit-thing-settings} for C and C++:
@example
@group
@code{end}, stop at the end of @var{thing}.
Like in @code{treesit-thing-prev}, @var{thing} can be a thing symbol
-defined in @var{treesit-thing-settings}, or a thing definition.
+defined in @code{treesit-thing-settings}, or a thing definition.
@var{tactic} determines how this function moves between things. It can
be @code{nested}, @code{top-level}, @code{restricted}, or @code{nil}.
position must be strictly less than @var{position}.
@var{thing} can be either a thing symbol defined in
-@var{treesit-thing-settings}, or a thing definition.
+@code{treesit-thing-settings}, or a thing definition.
@end defun
@findex treesit-beginning-of-thing
@code{treesit-thing-at-point} returns the thing at point.
There are also defun commands that specifically use the @code{defun}
-definition (as a fallback of @var{treesit-defun-type-regexp}), like
+definition (as a fallback of @code{treesit-defun-type-regexp}), like
@code{treesit-beginning-of-defun}, @code{treesit-end-of-defun}, and
@code{treesit-defun-at-point}. In addition, these functions use
-@var{treesit-defun-tactic} as the navigation tactic. They are described
-in more detail in other sections (@pxref{Tree-sitter Major Modes}).
+@code{treesit-defun-tactic} as the navigation tactic. They are
+described in more detail in other sections (@pxref{Tree-sitter Major
+Modes}).
@node Multiple Languages
@section Parsing Text in Multiple Languages
determine the ranges in which the embedded parsers operate.
@vindex treesit-primary-parser
-Major modes should set @var{treesit-primary-parser} to the primary
+Major modes should set @code{treesit-primary-parser} to the primary
parser before calling @code{treesit-major-mode-setup}, so that Emacs can
configure the primary parser correctly for font-lock and other features.
-Lisp programs should call @code{treesit-update-ranges} to make sure
-the ranges for each parser are correct before using parsers in a
-buffer, and call @code{treesit-language-at} to figure out the language
-responsible for the text at some position. These two functions don't
-work by themselves, they need major modes to set
-@var{treesit-range-settings} and
-@var{treesit-language-at-point-function}, which do the actual work.
+Lisp programs should call @code{treesit-update-ranges} to make sure the
+ranges for each parser are correct before using parsers in a buffer, and
+call @code{treesit-language-at} to figure out the language responsible
+for the text at some position. These two functions don't work by
+themselves; they need major modes to set @code{treesit-range-settings}
+and @code{treesit-language-at-point-function}, which do the actual work.
These functions and variables are explained in more detail towards the
end of the section.
-@b{In short}, multi-language major modes should set
-@var{treesit-primary-parser}, @var{treesit-range-settings}, and
-@var{treesit-language-at-point-function} before calling
+In short, multi-language major modes should set
+@code{treesit-primary-parser}, @code{treesit-range-settings}, and
+@code{treesit-language-at-point-function} before calling
@code{treesit-major-mode-setup}.
@heading Getting and setting ranges