diff options
| author | Yuan Fu | 2023-01-02 14:15:36 -0800 |
|---|---|---|
| committer | Yuan Fu | 2023-01-02 14:25:54 -0800 |
| commit | aef869e74f47bbe00c8cf0cb02cea20aa0c33a6d (patch) | |
| tree | 2db5efb43879cb82c4e2d16f3a1e5b9e163acfa6 | |
| parent | 4ef12cfb1fc3f08fc17f0ed622ddfcb1d26cefc8 (diff) | |
| download | emacs-aef869e74f47bbe00c8cf0cb02cea20aa0c33a6d.tar.gz emacs-aef869e74f47bbe00c8cf0cb02cea20aa0c33a6d.zip | |
; Update tree-sitter manual
* doc/lispref/positions.texi (List Motion): Replace
treesit-defun-prefer-top-level with treesit-defun-tactic.
| -rw-r--r-- | doc/lispref/positions.texi | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index 68e948bacd8..f47720184a3 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi | |||
| @@ -848,25 +848,14 @@ The value of this variable is a regexp matching the node type of defun | |||
| 848 | nodes. (For ``node'' and ``node type'', @pxref{Parsing Program Source}.) | 848 | nodes. (For ``node'' and ``node type'', @pxref{Parsing Program Source}.) |
| 849 | 849 | ||
| 850 | For example, @code{python-mode} sets this variable to a regexp that | 850 | For example, @code{python-mode} sets this variable to a regexp that |
| 851 | matches either @code{function_definition} or @code{class_definition}. | 851 | matches either @code{"function_definition"} or @code{"class_definition"}. |
| 852 | @end defvar | 852 | @end defvar |
| 853 | 853 | ||
| 854 | @defvar treesit-defun-prefer-top-level | 854 | @defvar treesit-defun-tactic |
| 855 | If this variable is non-@code{nil}, Emacs skips nested defuns, when it | 855 | This variable determines how does Emacs treat nested defuns. If the |
| 856 | looks for beginning and end of a defun, and prefers to go to the | 856 | value is @code{top-level}, navigation functions only move across |
| 857 | top-level defun instead. | 857 | top-level defuns, if the value is @code{nested}, navigation functions |
| 858 | 858 | recognize nested defuns. | |
| 859 | In some languages, a defun could be nested in another one. By default, | ||
| 860 | Emacs stops at the first defun it encounters. But if this variable's | ||
| 861 | value is @code{t}, whenever Emacs finds a defun node, it tries to go | ||
| 862 | up the parse tree until it finds the top-level defun. | ||
| 863 | |||
| 864 | This variable can also be a list of cons cells of the form | ||
| 865 | @w{@code{(@var{from} . @var{to}))}}, where @var{from} and @var{to} are | ||
| 866 | regexps matching tree-sitter node types. When Emacs finds a defun | ||
| 867 | node whose type matches any of the @var{from} regexps in the list, it | ||
| 868 | then tries to go up the parse tree until it finds a higher-level node | ||
| 869 | matching the corresponding @var{to} regexp. | ||
| 870 | @end defvar | 859 | @end defvar |
| 871 | 860 | ||
| 872 | @node Skipping Characters | 861 | @node Skipping Characters |