Rename treesit-toggle-sexp-type to treesit-cycle-sexp-type.

* lisp/treesit.el (treesit-cycle-sexp-type):
Rename from 'treesit-toggle-sexp-type'.  Fix docstring.
https://lists.gnu.org/archive/html/emacs-devel/2025-04/msg00291.html
This commit is contained in:
Juri Linkov 2025-04-11 19:34:29 +03:00
parent 53058e15c3
commit 695edc5b55
2 changed files with 9 additions and 10 deletions

View file

@ -537,15 +537,15 @@ This variable has no effect when Transient Mark mode is off.
** Tree-sitter
*** New command 'treesit-toggle-sexp-type'.
It toggles the type of navigation for commands that move across sexp's
*** New command 'treesit-cycle-sexp-type'.
It cycles the type of navigation for commands that move across sexp's
and lists, such as 'treesit-forward-sexp', 'treesit-forward-list',
'treesit-down-list', and 'treesit-up-list'. The type can be either
'list', the default, or 'sexp'.
With the default 'list' type these commands move using syntax tables for
symbols and using the thing 'list' for lists.
With the 'sexp' type these commands move by tree-sitter defined parser nodes
defined by the tree-sitter thing 'sexp' as determined by 'treesit-thing-at'.
With the 'sexp' type these commands move across nodes defined by
the tree-sitter thing 'sexp' in 'treesit-thing-settings'.
** Text mode

View file

@ -3196,11 +3196,10 @@ ARG is described in the docstring of `up-list'."
(user-error "At top level")))
(setq cnt (- cnt inc)))))
(defun treesit-toggle-sexp-type ()
"Toggle the type of navigation for sexp and list commands.
This type toggle affects navigation commands such as
`treesit-forward-sexp', `treesit-forward-list', `treesit-down-list',
`treesit-up-list'.
(defun treesit-cycle-sexp-type ()
"Cycle the type of navigation for sexp and list commands.
This type affects navigation commands such as `treesit-forward-sexp',
`treesit-forward-list', `treesit-down-list', `treesit-up-list'.
The type can be `list' (the default) or `sexp'.
@ -3224,7 +3223,7 @@ without distinction between symbols and lists."
(if treesit-sexp-type-regexp
#'treesit-forward-sexp
#'treesit-forward-sexp-list))
(message "Toggle sexp type to navigate %s"
(message "Cycle sexp type to navigate %s"
(or (and treesit-sexp-type-regexp
"treesit nodes")
"syntax symbols and treesit lists"))))