summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorTheodor Thornhill <theo@thornhill.no>2022-12-25 20:11:59 +0100
committerStefan Monnier <monnier@iro.umontreal.ca>2022-12-28 13:00:43 -0500
commit7e98b8a0fa67f51784024fac3199d774dfa77192 (patch)
tree7677db3c9e7685f40f7bbd8b214350ceb0065396 /etc
parent7dc24fb611c72697b7d34ba2abce0a0abc972a6b (diff)
downloademacs-7e98b8a0fa67f51784024fac3199d774dfa77192.tar.gz
Add treesit-transpose-sexps (bug#60128)
We don't really need to rely on forward-sexp to define what to transpose. In tree-sitter we can consider siblings as "balanced expressions", and swap them without doing any movement to calculate where the siblings in question are. * lisp/simple.el (transpose-sexps-function): New defvar-local. (transpose-sexps): Use the new defvar-local if available. (transpose-subr): Check whether the mover function returns a cons of conses, then run transpose-subr-1 on the position-pairs. * lisp/treesit.el (treesit-transpose-sexps): New function.
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS9
1 files changed, 9 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index d17e1f1f89f..83aa81eb4b8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -44,6 +44,15 @@ example, as part of preview for iconified frames.
* Editing Changes in Emacs 30.1
+** New helper 'transpose-sexps-function'
+Emacs now can set this defvar to customize the behavior of the
+'transpose-sexps' function.
+
+** New function 'treesit-transpose-sexps'
+treesit.el now unconditionally sets 'transpose-sexps-function' for all
+Tree-sitter modes. This functionality utilizes the new
+'transpose-sexps-function'.
+
* Changes in Specialized Modes and Packages in Emacs 30.1
---