]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix documentation of recent commits related to treesit
authorEli Zaretskii <eliz@gnu.org>
Sat, 20 Apr 2024 06:53:35 +0000 (09:53 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 20 Apr 2024 11:11:00 +0000 (14:11 +0300)
* src/treesit.c (Ftreesit_parser_changed_ranges):
* doc/lispref/parsing.texi (Using Parser): Fix wording.

(cherry picked from commit 42776dc5b7702cec2feb787fbf770d91623b9818)

doc/lispref/parsing.texi
src/treesit.c

index 65672997bda463d2c1bdbee266b757fa6a393697..f79502f3babb6f8e0fbf76ffbbce0823df29fb52 100644 (file)
@@ -539,10 +539,10 @@ symbol, rather than a lambda function.
 This function returns the list of @var{parser}'s notifier functions.
 @end defun
 
-Sometimes a user might want to synchronously get the changed ranges of
-the last reparse, and @code{treesit-parser-changed-ranges} is just for
-it.  This function basically returns the @var{ranges} that the notifier
-functions were passed.
+Sometimes a Lisp program might need to synchronously get the changed
+ranges of the last reparse.  The function
+@code{treesit-parser-changed-ranges} exists for this purpose.  It
+returns the ranges which were passed to the notifier functions.
 
 @defun treesit-parser-changed-ranges parser &optional quiet
 This function returns the ranges that has been changed since last
@@ -552,8 +552,8 @@ mark the start and the end positions of a range.
 
 This function should almost always be called immediately after
 reparsing.  If it's called when there are new buffer edits that hasn't
-been reparsed, Emacs signals @code{treesit-unparsed-edits}, unless
-@var{quiet} is non-nil.
+been reparsed, Emacs signals the @code{treesit-unparsed-edits} error,
+unless the optional argument @var{quiet} is non-nil.
 
 Calling this function multiple times consecutively doesn't change its
 return value; it always returns the ranges affected by the last reparse.
index 763543612842e1395a27be13b097a5c00968944e..52d158b1bf88f6db488c07b7575c7870ab7b4b5b 100644 (file)
@@ -1833,13 +1833,13 @@ DEFUN ("treesit-parser-changed-ranges", Ftreesit_parser_changed_ranges,
        1, 2, 0,
        doc: /* Return the buffer regions affected by the last reparse of PARSER.
 
-Returns a list of cons (BEG . END), where each cons represents a region
-in which the buffer content was affected by the last reparse.
+Returns a list of cons cells (BEG . END), where each cons cell represents
+a region in which changes in buffer contents affected the last reparse.
 
 This function should almost always be called immediately after
 reparsing.  If it's called when there are new buffer edits that hasn't
-been reparsed, Emacs signals `treesit-unparsed-edits', unless QUIET is
-non-nil.
+been reparsed, Emacs signals the `treesit-unparsed-edits' error, unless
+optional argument QUIET is non-nil.
 
 Calling this function multiple times consecutively doesn't change its
 return value; it always returns the ranges affected by the last