diff options
| author | Eli Zaretskii | 2024-04-20 09:53:35 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2024-04-20 09:53:35 +0300 |
| commit | 42776dc5b7702cec2feb787fbf770d91623b9818 (patch) | |
| tree | 9a98d2703640fa51192c70e5e99c3562ee125fa9 | |
| parent | 71d2ec7aba3d6ef9386e807970b0bfaa2043d128 (diff) | |
| download | emacs-42776dc5b7702cec2feb787fbf770d91623b9818.tar.gz emacs-42776dc5b7702cec2feb787fbf770d91623b9818.zip | |
; Fix documentation of recent commits related to treesit
* src/treesit.c (Ftreesit_parser_changed_ranges):
* doc/lispref/parsing.texi (Using Parser): Fix wording.
| -rw-r--r-- | doc/lispref/parsing.texi | 12 | ||||
| -rw-r--r-- | src/treesit.c | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index 65672997bda..f79502f3bab 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi | |||
| @@ -539,10 +539,10 @@ symbol, rather than a lambda function. | |||
| 539 | This function returns the list of @var{parser}'s notifier functions. | 539 | This function returns the list of @var{parser}'s notifier functions. |
| 540 | @end defun | 540 | @end defun |
| 541 | 541 | ||
| 542 | Sometimes a user might want to synchronously get the changed ranges of | 542 | Sometimes a Lisp program might need to synchronously get the changed |
| 543 | the last reparse, and @code{treesit-parser-changed-ranges} is just for | 543 | ranges of the last reparse. The function |
| 544 | it. This function basically returns the @var{ranges} that the notifier | 544 | @code{treesit-parser-changed-ranges} exists for this purpose. It |
| 545 | functions were passed. | 545 | returns the ranges which were passed to the notifier functions. |
| 546 | 546 | ||
| 547 | @defun treesit-parser-changed-ranges parser &optional quiet | 547 | @defun treesit-parser-changed-ranges parser &optional quiet |
| 548 | This function returns the ranges that has been changed since last | 548 | 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. | |||
| 552 | 552 | ||
| 553 | This function should almost always be called immediately after | 553 | This function should almost always be called immediately after |
| 554 | reparsing. If it's called when there are new buffer edits that hasn't | 554 | reparsing. If it's called when there are new buffer edits that hasn't |
| 555 | been reparsed, Emacs signals @code{treesit-unparsed-edits}, unless | 555 | been reparsed, Emacs signals the @code{treesit-unparsed-edits} error, |
| 556 | @var{quiet} is non-nil. | 556 | unless the optional argument @var{quiet} is non-nil. |
| 557 | 557 | ||
| 558 | Calling this function multiple times consecutively doesn't change its | 558 | Calling this function multiple times consecutively doesn't change its |
| 559 | return value; it always returns the ranges affected by the last reparse. | 559 | return value; it always returns the ranges affected by the last reparse. |
diff --git a/src/treesit.c b/src/treesit.c index 76354361284..52d158b1bf8 100644 --- a/src/treesit.c +++ b/src/treesit.c | |||
| @@ -1833,13 +1833,13 @@ DEFUN ("treesit-parser-changed-ranges", Ftreesit_parser_changed_ranges, | |||
| 1833 | 1, 2, 0, | 1833 | 1, 2, 0, |
| 1834 | doc: /* Return the buffer regions affected by the last reparse of PARSER. | 1834 | doc: /* Return the buffer regions affected by the last reparse of PARSER. |
| 1835 | 1835 | ||
| 1836 | Returns a list of cons (BEG . END), where each cons represents a region | 1836 | Returns a list of cons cells (BEG . END), where each cons cell represents |
| 1837 | in which the buffer content was affected by the last reparse. | 1837 | a region in which changes in buffer contents affected the last reparse. |
| 1838 | 1838 | ||
| 1839 | This function should almost always be called immediately after | 1839 | This function should almost always be called immediately after |
| 1840 | reparsing. If it's called when there are new buffer edits that hasn't | 1840 | reparsing. If it's called when there are new buffer edits that hasn't |
| 1841 | been reparsed, Emacs signals `treesit-unparsed-edits', unless QUIET is | 1841 | been reparsed, Emacs signals the `treesit-unparsed-edits' error, unless |
| 1842 | non-nil. | 1842 | optional argument QUIET is non-nil. |
| 1843 | 1843 | ||
| 1844 | Calling this function multiple times consecutively doesn't change its | 1844 | Calling this function multiple times consecutively doesn't change its |
| 1845 | return value; it always returns the ranges affected by the last | 1845 | return value; it always returns the ranges affected by the last |