diff options
| author | Eli Zaretskii | 2022-11-27 10:06:02 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2022-11-27 10:06:02 +0200 |
| commit | 80dcd78ff1fce3241043edf1951289eef0bf50c9 (patch) | |
| tree | 4a78aa9f3f5f35ce4c9dd2a217e10aa3620b90a4 | |
| parent | c3240ca540baa21d017512e8b2fcbdcbade08864 (diff) | |
| download | emacs-80dcd78ff1fce3241043edf1951289eef0bf50c9.tar.gz emacs-80dcd78ff1fce3241043edf1951289eef0bf50c9.zip | |
; Fix recent documentation changes in treesit.el
* lisp/treesit.el (treesit-font-lock-level)
(treesit-font-lock-recompute-features): Doc fixes.
| -rw-r--r-- | lisp/treesit.el | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/treesit.el b/lisp/treesit.el index ab00b0e8a73..bae44f6b0ab 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el | |||
| @@ -521,21 +521,22 @@ omitted, default END to BEG." | |||
| 521 | 'treesit-error) | 521 | 'treesit-error) |
| 522 | 522 | ||
| 523 | (defvar-local treesit-font-lock-level 3 | 523 | (defvar-local treesit-font-lock-level 3 |
| 524 | "The decoration level used by tree-sitter fontification. | 524 | "Decoration level to be used by tree-sitter fontifications. |
| 525 | |||
| 525 | Major modes categorize their fontification features into levels, | 526 | Major modes categorize their fontification features into levels, |
| 526 | from 1 being the absolute minimal, to 4 being maximally | 527 | from 1 which is the absolute minimum, to 4 that yields the maximum |
| 527 | fontified. | 528 | fontifications. |
| 528 | 529 | ||
| 529 | Level 1 usually contains only comments and definitions. | 530 | Level 1 usually contains only comments and definitions. |
| 530 | Level 2 usually adds keywords, strings, constants, types, etc. | 531 | Level 2 usually adds keywords, strings, constants, types, etc. |
| 531 | Level 3 usually represents a full-blown fontification, including | 532 | Level 3 usually represents a full-blown fontification, including |
| 532 | assignment, constants, numbers, properties, etc. | 533 | assignment, constants, numbers, properties, etc. |
| 533 | Level 4 fontifies everything that can be fontified: delimiters, | 534 | Level 4 adds everything else that can be fontified: delimiters, |
| 534 | operators, brackets, all functions and variables, etc. | 535 | operators, brackets, all functions and variables, etc. |
| 535 | 536 | ||
| 536 | In addition to the decoration level, individual features can be | 537 | In addition to the decoration level, individual features can be |
| 537 | turned on/off by `treesit-font-lock-recompute-features'. Changes | 538 | turned on/off by calling `treesit-font-lock-recompute-features'. |
| 538 | to this variable also requires calling | 539 | Changing the decoration level requires calling |
| 539 | `treesit-font-lock-recompute-features' to have an effect.") | 540 | `treesit-font-lock-recompute-features' to have an effect.") |
| 540 | 541 | ||
| 541 | (defvar-local treesit--font-lock-query-expand-range (cons 0 0) | 542 | (defvar-local treesit--font-lock-query-expand-range (cons 0 0) |
| @@ -735,12 +736,12 @@ REMOVE-LIST. | |||
| 735 | 736 | ||
| 736 | If both ADD-LIST and REMOVE-LIST are omitted, recompute each | 737 | If both ADD-LIST and REMOVE-LIST are omitted, recompute each |
| 737 | feature according to `treesit-font-lock-feature-list' and | 738 | feature according to `treesit-font-lock-feature-list' and |
| 738 | `treesit-font-lock-level'. Let N be the value of | 739 | `treesit-font-lock-level'. If the value of `treesit-font-lock-level', |
| 739 | `treesit-font-lock-level', features in the first N sublists of | 740 | is N, then the features in the first N sublists of |
| 740 | `treesit-font-lock-feature-list' are enabled, and other features | 741 | `treesit-font-lock-feature-list' are enabled, and the rest of |
| 741 | are disabled. | 742 | the features are disabled. |
| 742 | 743 | ||
| 743 | ADD-LIST and REMOVE-LIST are each a list of feature symbols. The | 744 | ADD-LIST and REMOVE-LIST are lists of feature symbols. The |
| 744 | same feature symbol cannot appear in both lists; the function | 745 | same feature symbol cannot appear in both lists; the function |
| 745 | signals the `treesit-font-lock-error' error if that happens." | 746 | signals the `treesit-font-lock-error' error if that happens." |
| 746 | (when-let ((intersection (cl-intersection add-list remove-list))) | 747 | (when-let ((intersection (cl-intersection add-list remove-list))) |