summaryrefslogtreecommitdiff
path: root/doc/lispref/modes.texi
Commit message (Collapse)AuthorAge
* Merge commit '1bc9dfc5bee'Stefan Monnier2023-03-27
|\
| * ; Improve documentation of :predicate in globalized minor modesEli Zaretskii2023-03-23
| | | | | | | | | | | | | | * doc/lispref/modes.texi (Defining Minor Modes): * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Improve documentation of the :predicate keyword in defining globalized minor modes.
* | * src/buffer.c (mode-line-format): Reorder and reformat %-construct docsPhil Sainty2023-03-27
| | | | | | | | | | | | | | | | | | The original formatting dates back to the earliest commits. It saved a few lines but was harder to follow. As windows are typically taller now than the terminals of the time, this reformatting now makes better sense for readabiity. See bug#57080. * doc/lispref/modes.texi: Order change for consistency. Add index.
* | * doc/lispref/modes.texi: Improve docs for obsolete '%m' constructPhil Sainty2023-03-27
| | | | | | | | Bug #57080.
* | Improve docs for global-mode-string / %M constructPhil Sainty2023-03-27
|/ | | | | * src/xdisp.c (global-mode-string): Update docstring. * doc/lispref/modes.texi: Update manual.
* Fix empty line indentation in c-ts-mode (bug#61997)Yuan Fu2023-03-07
| | | | | | | | | | * lisp/progmodes/c-ts-mode.el: (c-ts-mode--indent-styles): Handle the empty line case. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test. * doc/lispref/modes.texi (Parser-based Indentation): Update manual. * lisp/treesit.el (treesit-simple-indent-presets): Support null as a value for NODE-TYPE in the 'match' matcher.
* Change tree-sitter indent anchor 'point-min' to 'column-0'Yuan Fu2023-03-04
| | | | | | | | | | | | | | Point-min isn't necessarily at column 0, using line-beginning-position is better. column-0 is also more intuitive. * doc/lispref/modes.texi (Parser-based Indentation): Update manual. * lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): * lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--indent-rules): * lisp/progmodes/typescript-ts-mode.el: (typescript-ts-mode--indent-rules): Change point-min to column-0. * lisp/treesit.el (treesit-simple-indent-presets): Change point-min to column-0.
* Rename the newly added -ref- faces to -use-Dmitry Gutov2023-02-28
| | | | | | * lisp/font-lock.el (font-lock-variable-use-face) (font-lock-property-use-face): Rename from font-lock-variable-ref-face and font-lock-property-ref-face. Update all references (bug#61655).
* New tree-sitter indent anchor standalone-parent used by c-ts-modeYuan Fu2023-02-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When writing c-ts-mode Theo used parent-bol which works well except one case: 1 for (int i=0; 2 i < 5; 3 i++) { 4 func(i); 5 } In this case, when indenting "func(i)", parent-bol returns the start of "i++" on line 3, instead of the "correct" anchor, the start of "for" on line 1. parent-bol would have worked if the "for (...) {" part is in one line. To support this case I tried numerous things and added a bunch of stuff, culminating in c-ts-common-statement-offset. It's complicated, requires extra setup, and slow. Not anymore! I think the new anchor standalone-parent really captures the logic behind how people expect indentation to work. It's simple and fast, and requires no setup. * doc/lispref/modes.texi (Parser-based Indentation): Update manual. * lisp/progmodes/c-ts-mode.el: (c-ts-mode--standalone-grandparent): New anchor. (c-ts-mode--indent-styles): Replace c-ts-common-statement-offset with standalone-parent. (c-ts-base-mode): Add comment. * lisp/treesit.el: (treesit-simple-indent-presets): New anchor standalone-parent.
* Add more/finer faces for tree-sitterDmitry Gutov2023-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Faces for Font Lock): Update the list of faces (bug#61655). * etc/NEWS: Update the list of new faces. * lisp/cus-theme.el (custom-theme--listed-faces): Update. * lisp/font-lock.el (font-lock-function-call-face) (font-lock-variable-ref-face, font-lock-property-ref-face): New faces. (font-lock-property-name-face): Rename from 'font-lock-property-face'. * lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Use new faces. More 'enumerator' query to 'definition' feature. (c-ts-mode--fontify-declarator, c-ts-mode--fontify-variable): Use new faces. * lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--font-lock-settings): Use new faces. * lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings): Use new faces. * lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings): Use new faces. * lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings): Use new faces. * lisp/progmodes/js.el (js--treesit-fontify-assignment-lhs) (js--treesit-font-lock-settings): Use new faces. Highlight variable definitions inside array and object destructuring patterns. * lisp/progmodes/python.el (python--treesit-variable-p): Exclude identifiers in parameters. (python--treesit-settings): Use new faces. Highlight function parameters. Move 'keyword' up to still highlight 'self' as keyword. * lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings): Use new faces. * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings): Use new faces. * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): Use new faces. * lisp/textmodes/css-mode.el (css--treesit-settings): Use font-lock-property-ref-face. * lisp/textmodes/toml-ts-mode.el (toml-ts-mode--font-lock-settings): Use font-lock-property-ref-face. * lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode--font-lock-settings): Same.
* Improve tree-sitter indent anchor prev-adaptive-prefix (bug#61314)Yuan Fu2023-02-19
| | | | | | | | | | | | | | | | | | | | | | Now prev-adaptive-prefix looks at the current line and checks if it begins with a prefix itself. If it does, prev-adaptive-prefix tries to place the anchor before the prefix on the previous line, rather than after it. - prev line - this line -> This line starts with a "-", i.e., begins with a prefix, so we place the anchor at the beginning of the "-" of the previous line, rather than after it - prev line this line -> This line doesn't start with a prefix, so the anchor is placed after the previous line's "-". * doc/lispref/modes.texi (Parser-based Indentation): Update manual. * lisp/treesit.el: (treesit-simple-indent-presets): Add local variable this-line-has-prefix, base what anchor to return on the value of this-line-has-prefix and whether the prev line has a prefix.
* Improve documentation of 'header-line-indent-mode'Eli Zaretskii2023-02-03
| | | | | | | | | | | | | | | * doc/lispref/modes.texi (Header Lines): Rewrite the documentation of 'header-line-indent-mode' and its two variables. Fix the example. * doc/lispref/display.texi (Pixel Specification): More accurate description of what happens with :align-to in header-lines. Improve indexing. (Bug#61239) * src/buffer.c (syms_of_buffer) <header-line-format>: * lisp/display-line-numbers.el (header-line-indent) (header-line-indent-width, header-line-indent-mode): Doc fixes. * etc/NEWS: Enhance the announcement of 'header-line-indent-mode'.
* Allow offset in tree-sitter indent rules to be functionsYuan Fu2023-01-15
| | | | | | | | This is needed for fixing C indentation. See next comment. * doc/lispref/modes.texi (Parser-based Indentation): Update manual. * lisp/treesit.el (treesit-simple-indent): Try evaluating OFFSET as a function if it's not integer nor variable.
* Make sure NODE is not the root node in tree-sitter indent (bug#60602)Yuan Fu2023-01-08
| | | | | | | | | | | | | | | | | | There are two possible ways to solve the problem raised in the bug report: either make sure NODE is never the root (so that parent is never nil), or allow parent to be nil. If we go with the latter, a lot of matcher and anchor functions need change (they need to guard against a null parent). I tried it, and needing to check for null parent is pretty annoying. In comparison, if NODE is never the root, it is very convenient for the user, and it doesn't complicate the rule that much (and it's rather intuitive, people usually don't think of the case where NODE is the root node). So that's what I choose. * doc/lispref/modes.texi (Parser-based Indentation): Update manual. * lisp/treesit.el (treesit-indent-function): Update docstring. (treesit--indent-1): Make sure NODE is not the root.
* Tree-sitter doc fixes (bug#60524)Juri Linkov2023-01-04
| | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Parser-based Font Lock): Replace :lang with :language. * doc/lispref/parsing.texi (Language Grammar): Replace treesit-load-suffixes with dynamic-library-suffixes. (Retrieving Nodes): Fix function names. (Tree-sitter Major Modes): Fix treesit-ready-p args. Fix pxref to Parser-based Indentation. (Tree-sitter C API): Fix function names. * lisp/treesit.el (treesit--simple-indent-eval): Remove cond BODY duplicated from CONDITION. (treesit)<define-short-documentation-group>: Fix function names.
* ; Fix tree-sitter manual title caseYuan Fu2023-01-02
| | | | | | * doc/lispref/elisp.texi: * doc/lispref/modes.texi: * doc/lispref/parsing.texi: Change to title case.
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-01
|
* Change "language definition" to "language grammar" in manual.Yuan Fu2022-12-30
| | | | | | | | | | | | | | "Language grammar" is apparently the more widely used term among people talking about tree-sitter. To avoid confusion, I think it's good to use that rather than "language definition", which is a term that I made up :-) Feel free to revert this if it is too much change. * doc/lispref/elisp.texi: * doc/lispref/modes.texi: * doc/lispref/parsing.texi: * lisp/treesit.el: Change "language definition" to "language grammar".
* Add tree-sitter helper functions for ImenuYuan Fu2022-12-27
| | | | | | | | | | | | | | | | | | | We didn't add an integration for Imenu because we aren't sure what should it look like. Now we have a pretty good idea. All the major modes copy-paste the two Imenu functions and tweaks them in a standard way. With the addition of treesit-defun-type-regexp and treesit-defun-name-function, now is a good time to standardize Imenu integration. In the next commit we update all the major modes to use this integration. * doc/lispref/modes.texi (Imenu): Add manual. * doc/lispref/parsing.texi (Tree-sitter major modes): Update manual. * lisp/treesit.el (treesit-simple-imenu-settings): New varaible. (treesit--simple-imenu-1) (treesit-simple-imenu): New functions. (treesit-major-mode-setup): Setup Imenu.
* ; * doc/lispref/modes.texi (Parser-based Font Lock): Minor fixes.Yuan Fu2022-12-26
|
* Fix block comment indent and filling for c-ts-mode (bug#59763)Yuan Fu2022-12-24
| | | | | | | | | | | | | | | Now indent and filling works like in c-mode. The only noticeable missing piece is that the "*/" is not attached to the last sentence when filling. c-mode does it by replacing whitespaces between the "*/" and the end of the last sentence with xxx, fill it, then change the xxx back. I don't know if we should do that in c-ts-mode's filling. * doc/lispref/modes.texi (Parser-based Indentation): Add new preset. * lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Add new indent rule. (c-ts-mode--fill-paragraph): New function. (c-ts-base-mode): Setup paragraph-start, adaptive-fill, etc. * lisp/treesit.el (treesit-simple-indent-presets): Add new preset.
* Remove comment-start-skip preset in tree-sitter indentation engineYuan Fu2022-12-18
| | | | | | | | | | | | | | | Comment indentation should use a adaptive-fill-based indent, rather than comment-start-skip. Also remove manual description of removed variables in treesit.el and add documentation for n-p-gp upon request. * doc/lispref/modes.texi (Parser-based Indentation) * lisp/treesit.el (treesit-simple-indent-presets): Add n-p-gp, remove treesit-comment-start/end, remove comment-start-skip. * doc/lispref/parsing.texi (Tree-sitter major modes): Remove treesit-comment-start/end.
* ; Fix typosStefan Kangas2022-12-16
|
* ; Fix typosStefan Kangas2022-11-22
|
* Merge remote-tracking branch 'savannah/master' into feature/tree-sitterYuan Fu2022-11-21
|\
| * ; Fix quoting of non-nil in texinfo sourcesStefan Kangas2022-10-27
| |
| * Merge from origin/emacs-28Stefan Kangas2022-10-20
| |\ | | | | | | | | | 4b2c83eeaf ; * doc/lispref/modes.texi (Defining Minor Modes): Explain...
| | * ; * doc/lispref/modes.texi (Defining Minor Modes): Explain TURN-ON.Eli Zaretskii2022-10-19
| | |
| * | Merge from origin/emacs-28Stefan Kangas2022-10-16
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 067361f3a2 ; Improve documentation of 'C-M-i' fdb6f7cf26 ; Fix documentation of 'comp-enable-subr-trampolines' be30369e01 ; Avoid incorrect indentation in an @example. 4bd3dd505e Document how to control where the *.eln files are written b7d7c2d9e9 Add cross-reference to alternative syntaxes for Unicode # Conflicts: # doc/emacs/custom.texi
| | * ; Avoid incorrect indentation in an @example.Eli Zaretskii2022-10-15
| | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Search-based Fontification): Avoid incorrect indentation in an @example. Reported by Akib Azmain Turja <akib@disroot.org>.
* | | ; Improve recently-modified documentationEli Zaretskii2022-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/python.el (python-base-mode) (python--treesit-fontify-string): * lisp/textmodes/css-mode.el (css-base-mode): * lisp/treesit.el (treesit-ready-p, treesit-comment-end) (treesit-simple-indent-presets): Fix typos and wording in doc strings. * doc/lispref/parsing.texi (Tree-sitter major modes): * doc/lispref/modes.texi (Parser-based Indentation): Fix wording and add cross-references.
* | | Fix tree-sitter comment indentation for C-like languagesYuan Fu2022-11-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal is to indent like this: /* comment comment --> This line aligns with the beginning of the first line */ --> This line aligns with the opening comment token * lisp/treesit.el (treesit-comment-start) (treesit-comment-end): New variables. (treesit-simple-indent-presets): New preset comment-end, comment-start, comment-start-skip * lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles) (c-ts-mode) * lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules) (java-ts-mode) * lisp/progmodes/js.el (js--treesit-indent-rules) (js-ts-mode) * lisp/progmodes/ts-mode.el (ts-mode--indent-rules) (ts-mode): Add identical indent rules to each mode, and set identical treesit-comment-start/end's. * doc/lispref/modes.texi (Parser-based Indentation) * doc/lispref/parsing.texi (Tree-sitter major modes): Update manual.
* | | ; Elaborate on tree-sitter fontification features documentationYuan Fu2022-11-17
| | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Parser-based Font Lock) * lisp/treesit.el (treesit-font-lock-feature-list): Explain in more detail, and change some features.
* | | Remove the contextual hack in tree-sitter fontificationYuan Fu2022-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now have a better facility that can replace the contextual hack. The C part is in the previous commit, and the Lisp part work will be in the next commit. * doc/lispref/modes.texi (Parser-based Font Lock): Update manual. * lisp/progmodes/js.el (js--treesit-font-lock-settings) * lisp/progmodes/python.el (python--treesit-settings) * lisp/progmodes/ts-mode.el (ts-mode--font-lock-settings): Stop marking contextual nodes. * lisp/treesit.el (treesit-font-lock-contextual-post-process): Remove function. (treesit-font-lock-fontify-region): Remove code processing contextual nodes.
* | | Add more font-lock faces (Bug#58940)Randy Taylor2022-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/font-lock.el (font-lock-bracket-face, font-lock-delimiter-face, font-lock-escape-face, font-lock-number-face, font-lock-misc-punctuation-face, font-lock-operator-face, font-lock-property-face, font-lock-punctuation-face): Define new faces. * lisp/cus-theme.el (custom-theme--listed-faces): Add them to the list. * doc/lispref/modes.texi (Faces for Font Lock): Document them. * etc/NEWS: Mention them.
* | | ; Minor improvements in wording of tree-sitter docsEli Zaretskii2022-11-09
| | | | | | | | | | | | | | | | | | * doc/lispref/parsing.texi (Multiple Languages): * doc/lispref/modes.texi (Parser-based Font Lock): Improve wording.
* | | ; Improve tree-sitter documentationYuan Fu2022-11-08
| | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Parser-based Font Lock) * doc/lispref/parsing.texi (Multiple Languages) * lisp/treesit.el (treesit-range-rules) (treesit-font-lock-rules): Improve phrasing around queries and keyword and values.
* | | Add tree-sitter indent preset "point-min"Yuan Fu2022-11-07
| | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Parser-based Indentation): Update manual. * lisp/treesit.el (treesit-simple-indent-presets): Add preset. Update docstring.
* | | ; More documentation improvements for treesitEli Zaretskii2022-11-06
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/treesit.el (treesit-language-at, treesit-range-rules) (treesit-font-lock-rules): Doc fixes. * doc/lispref/parsing.texi (Multiple Languages): * doc/lispref/modes.texi (Parser-based Font Lock): Fix wording.
* | | Allow tree-sitter indent offset to be a variableYuan Fu2022-11-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Parser-based Indentation): Update manual. * lisp/progmodes/js.el (js--treesit-indent-rules): Change all occurance of ,js-indent-level to js-indent-level. * lisp/progmodes/ts-mode.el (ts-mode--indent-rules): Change all occurance of ,ts-mode-indent-offset to ts-mode-indent-offset. * lisp/treesit.el (treesit-simple-indent-rules): Change docstring. (treesit-simple-indent): Allow offset to be a variable.
* | | ; Fix documentation for tree-sitterYuan Fu2022-11-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Parser-based Font Lock): Fix the signature style. * doc/lispref/parsing.texi (Language Definitions): Rephrase the section, remove documentation for deleted functions, fix signature style. * lisp/treesit.el (treesit-range-rules) (treesit-font-lock-rules): Change ARGS to QUERY-SPECS, fix docstring. * lisp/treesit.el (treesit-inspect-mode): Fix docstring.
* | | ; Minor fixes to documentationEli Zaretskii2022-11-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/treesit.el (treesit-ready-p, treesit-inspect-mode) (treesit-range-settings, treesit-range-rules) (treesit--merge-ranges, treesit-update-ranges) (treesit-font-lock-rules, treesit-font-lock-feature-list) (treesit-font-lock-contextual-post-process) (treesit-font-lock-recompute-features): Doc fixes. * lisp/progmodes/js.el (js--fontify-template-string): Doc fix. * doc/lispref/modes.texi (Parser-based Indentation): * doc/lispref/positions.texi (List Motion): * doc/lispref/parsing.texi (Tree-sitter major modes): * doc/lispref/parsing.texi (Multiple Languages): Fix wording and markup.
* | | Pass region start and end to tree-sitter fontification functionsYuan Fu2022-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Parser-based Font Lock): Update manual. * lisp/progmodes/js.el (js--fontify-template-string) * lisp/progmodes/python.el (python--treesit-fontify-string): Update function to only fontify within the region. * lisp/treesit.el (treesit-font-lock-rules): Update docstring. (treesit-font-lock-fontify-region): Pass START and END to fontification functions.
* | | Add handling of contextual entities in tree-sitter font-lockYuan Fu2022-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/python.el: Remove function. (python--treesit-settings): Capture contextual node. * lisp/treesit.el (treesit--set-nonsticky): (treesit-font-lock-contextual-post-process): New functions. (treesit-font-lock-fontify-region): Change local variable START and END to NODE-START and NODE-END, handle special capture name "contextual". * doc/lispref/modes.texi (Parser-based Font Lock): Update manual.
* | | Change signature of tree-sitter font-lock functionsYuan Fu2022-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change from (START END NODE OVERRIDE &rest _) to (NODE OVERRIDE &rest _) START and END aren't used frequently enough to justify. If a fontification function needs them, it can get them from NODE. * doc/lispref/modes.texi (Parser-based Font Lock): Update manual. * lisp/progmodes/js.el (js--fontify-template-string) * lisp/progmodes/python.el (python--treesit-fontify-string) (python--treesit-fontify-string-end): Change signature. * lisp/treesit.el (treesit-font-lock-rules): Update docstring. (treesit-font-lock-fontify-region): Remove START and END arguments.
* | | Add an argument OVERRIDE to tree-sitter font-lock functionsYuan Fu2022-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Parser-based Font Lock): Reflect this change in manual. * lisp/progmodes/js.el (js--fontify-template-string): Add _OVERRIDE argument. * lisp/progmodes/python.el (python--treesit-fontify-string): Add _OVERRIDE argument. * lisp/treesit.el (treesit-font-lock-rules): Update docstring. (treesit-fontify-with-override): New function. (treesit-font-lock-fontify-region): Extract out into treesit-fontify-with-override.
* | | Use tree-sitter for font-lock's syntactic function (optionally)Yuan Fu2022-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, we rebind font-lock-fontify-region-function and call font-lock's function in tree-sitter's function, and the order of fontification is tree-sitter, font-lock syntax, font-lock regexp. Now we make font-lock's syntax function customizable and replace it with tree-sitter's function, and the order of fontification is tree-sitter, font-lock regexp. * doc/lispref/modes.texi (Parser-based Font Lock): Reflect the change in manual. * lisp/font-lock.el (font-lock-fontify-syntactically-function): New varaible. (font-lock-default-fontify-region): Call font-lock-fontify-syntactically-function rather. (font-lock-fontify-syntactically-region): Rename to font-lock-default-fontify-syntactically (font-lock-default-fontify-syntactically): Rename to this. * lisp/treesit.el (treesit-font-lock-fontify-region): Don't call font-lock functions. (treesit-font-lock-enable): Remove this function. It is not used even before this change. (treesit-major-mode-setup): Instead of binding font-lock-fontify-region-function, now bind to font-lock-fontify-syntactically-function. And we can let font-lock do it's thing.
* | | Reflect recent change in tree-sitter manual sectionsYuan Fu2022-10-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Parser-based Font Lock): treesit-font-lock-enable is replaced by treesit-major-mode-setup. * doc/lispref/modes.texi (Parser-based Indentation): Mention treesit-major-mode-setup, * doc/lispref/parsing.texi (Tree-sitter major modes): Remove treesit-mode and global-treesit-mode, explain setup guideline.
* | | Refine handling of node at point in treesit-indentYuan Fu2022-10-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Parser-based Indentation): Document the semantic clearly. * lisp/treesit.el (treesit-simple-indent-presets): Replace with current-indentation. (treesit--indent-1): Now NODE always starts at BOL, and parent is always the smallest node above NODE that spans BOL. (treesit-indent): Don't use save-excurtion, no one else does.
* | | Reflect tree-sitter indent rule presets change in manualYuan Fu2022-10-28
| | | | | | | | | | | | | | | * doc/lispref/modes.texi (Parser-based Indentation): String equivalence checks are changed to regexp matching.