Rename treesit-toggle-sexp-mode to treesit-toggle-sexp-type.
* lisp/treesit.el (treesit-toggle-sexp-type): Rename from 'treesit-toggle-sexp-mode'. Fix docstring. https://lists.gnu.org/archive/html/emacs-devel/2025-04/msg00273.html
This commit is contained in:
parent
cb9aded6d9
commit
addcab6891
2 changed files with 14 additions and 14 deletions
10
etc/NEWS
10
etc/NEWS
|
@ -537,14 +537,14 @@ This variable has no effect when Transient Mark mode is off.
|
|||
|
||||
** Tree-sitter
|
||||
|
||||
*** New command 'treesit-toggle-sexp-mode'.
|
||||
It toggles the mode of navigation for commands that move across sexp's
|
||||
*** New command 'treesit-toggle-sexp-type'.
|
||||
It toggles 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'. This mode can be either
|
||||
'treesit-down-list', and 'treesit-up-list'. The type can be either
|
||||
'list', the default, or 'sexp'.
|
||||
In the default 'list' mode these commands move using syntax tables for
|
||||
With the default 'list' type these commands move using syntax tables for
|
||||
symbols and using the thing 'list' for lists.
|
||||
In 'sexp' mode these commands move by treesit-defined parser nodes
|
||||
With 'sexp' type these commands move by treesit-defined parser nodes
|
||||
defined by the treesit thing 'sexp' as determined by 'treesit-thing-at'.
|
||||
|
||||
---
|
||||
|
|
|
@ -3188,20 +3188,20 @@ ARG is described in the docstring of `up-list'."
|
|||
(user-error "At top level")))
|
||||
(setq cnt (- cnt inc)))))
|
||||
|
||||
(defun treesit-toggle-sexp-mode ()
|
||||
"Toggle the mode of navigation for sexp and list commands.
|
||||
This mode toggle affects navigation commands such as
|
||||
(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'.
|
||||
|
||||
The mode can be `list' (the default) or `sexp'.
|
||||
The type can be `list' (the default) or `sexp'.
|
||||
|
||||
The `list' mode uses the `list' thing defined in `treesit-thing-settings'.
|
||||
See `treesit-thing-at-point'. In this mode commands use syntax tables to
|
||||
The `list' type uses the `list' thing defined in `treesit-thing-settings'.
|
||||
See `treesit-thing-at-point'. With this type commands use syntax tables to
|
||||
navigate symbols and treesit definition to navigate lists.
|
||||
|
||||
The `sexp' mode uses the `sexp' thing defined in `treesit-thing-settings'.
|
||||
In this mode commands use only the treesit definition of parser nodes,
|
||||
The `sexp' type uses the `sexp' thing defined in `treesit-thing-settings'.
|
||||
With this type commands use only the treesit definition of parser nodes,
|
||||
without distinction between symbols and lists."
|
||||
(interactive)
|
||||
(if (not (treesit-thing-defined-p 'list (treesit-language-at (point))))
|
||||
|
@ -3216,7 +3216,7 @@ without distinction between symbols and lists."
|
|||
(if treesit-sexp-type-regexp
|
||||
#'treesit-forward-sexp
|
||||
#'treesit-forward-sexp-list))
|
||||
(message "Toggle to mode where sexp commands navigate %s"
|
||||
(message "Toggle sexp type to navigate %s"
|
||||
(or (and treesit-sexp-type-regexp
|
||||
"treesit nodes")
|
||||
"syntax symbols and treesit lists"))))
|
||||
|
|
Loading…
Add table
Reference in a new issue