[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 d90d7d15f2 9/9: ; Fix vindexes in parsing.texi
From: |
Yuan Fu |
Subject: |
emacs-29 d90d7d15f2 9/9: ; Fix vindexes in parsing.texi |
Date: |
Mon, 26 Dec 2022 04:48:09 -0500 (EST) |
branch: emacs-29
commit d90d7d15f2f78c37b9a5c775e617ab6f5cd5fb01
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
; Fix vindexes in parsing.texi
* doc/lispref/parsing.texi (Tree-sitter major modes): Replace vindex
with cross-reference to modes.texi. Add manual entry for
treesit-defun-type-regexp.
* lisp/treesit.el (treesit-defun-type-regexp): Use pred in docstring
since we use pred everywhere else.
---
doc/lispref/parsing.texi | 22 +++++++++++++++-------
lisp/treesit.el | 2 +-
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi
index 4b9cd18dd4..5d1b11935c 100644
--- a/doc/lispref/parsing.texi
+++ b/doc/lispref/parsing.texi
@@ -1715,17 +1715,14 @@ This function activates some tree-sitter features for a
major mode.
Currently, it sets up the following features:
@itemize
-@vindex treesit-font-lock-settings
@item
-If @code{treesit-font-lock-settings} is non-@code{nil}, it sets up
-fontification.
+If @code{treesit-font-lock-settings} (@pxref{Parser-based Font Lock})
+is non-@code{nil}, it sets up fontification.
-@vindex treesit-simple-indent-rules
@item
-If @code{treesit-simple-indent-rules} is non-@code{nil}, it sets up
-indentation.
+If @code{treesit-simple-indent-rules} (@pxref{Parser-based Font Lock})
+is non-@code{nil}, it sets up indentation.
-@vindex treesit-defun-type-regexp
@item
If @code{treesit-defun-type-regexp} is non-@code{nil}, it sets up
navigation functions for @code{beginning-of-defun} and
@@ -1782,6 +1779,17 @@ node is a defun node but doesn't have a name, or the
node is
@code{nil}, it should return @code{nil}.
@end defvar
+@defvar treesit-defun-type-regexp
+This variable determines which nodes are considered defuns by Emacs.
+It can be a regexp that matches the type of defun nodes.
+
+Sometimes not all nodes matched by the regexp are valid defuns.
+Therefore, this variable can also be a cons cell of the form
+@w{(@var{regexp} . @var{pred})}, where @var{pred} should be a function
+that takes a node as its argument, and returns @code{t} if the node is
+valid defun, or @code{nil} if it is not valid.
+@end defvar
+
@node Tree-sitter C API
@section Tree-sitter C API Correspondence
diff --git a/lisp/treesit.el b/lisp/treesit.el
index f3e1afd943..2130cd0061 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1622,7 +1622,7 @@ For example, \"(function|class)_definition\".
Sometimes not all nodes matched by the regexp are valid defuns.
In that case, set this variable to a cons cell of the
-form (REGEXP . FILTER), where FILTER is a function that takes a
+form (REGEXP . PRED), where PRED is a function that takes a
node (the matched node) and returns t if node is valid, or nil
for invalid node.
- emacs-29 updated (2608e5edcc -> d90d7d15f2), Yuan Fu, 2022/12/26
- emacs-29 2bcd1e9a99 3/9: ; * doc/lispref/parsing.texi (Retrieving Nodes): Add notice., Yuan Fu, 2022/12/26
- emacs-29 7c7950fe00 2/9: Add maintainer stub for tree-sitter files, Yuan Fu, 2022/12/26
- emacs-29 c6b0282645 5/9: ; Remove unused function in c-ts-mode, Yuan Fu, 2022/12/26
- emacs-29 6e52a9fcad 4/9: ; * doc/lispref/modes.texi (Parser-based Font Lock): Minor fixes., Yuan Fu, 2022/12/26
- emacs-29 8f68b6497e 7/9: Clean up python-ts-mode font-lock features, Yuan Fu, 2022/12/26
- emacs-29 eb26872837 8/9: Fix imenu for c-ts-mode (bug#60296), Yuan Fu, 2022/12/26
- emacs-29 d90d7d15f2 9/9: ; Fix vindexes in parsing.texi,
Yuan Fu <=
- emacs-29 cf32776622 1/9: ; * doc/lispref/parsing.texi (Using Parser): Remove deleted function., Yuan Fu, 2022/12/26
- emacs-29 28f26b11a1 6/9: Add comment indent and filling to other tree-sitter major modes, Yuan Fu, 2022/12/26