summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuan Fu <casouri@gmail.com>2025-02-17 13:29:46 -0800
committerYuan Fu <casouri@gmail.com>2025-02-17 13:38:15 -0800
commit237afc82b2ed147fe6b1773df303c448ded9679b (patch)
tree01ba8a5d84bdd936242d2036945cba211667a97e
parent928bad93609773ca5e9c94cf6e8f24e895e263d3 (diff)
downloademacs-237afc82b2ed147fe6b1773df303c448ded9679b.tar.gz
emacs-237afc82b2ed147fe6b1773df303c448ded9679b.tar.bz2
emacs-237afc82b2ed147fe6b1773df303c448ded9679b.zip
Rename treesit-add-simple-indent-rules
* lisp/treesit.el (treesit-add-simple-indent-rules): Rename to treesit-simple-indent-add-rules. * etc/NEWS: Update. * test/src/treesit-tests.el: (treesit-test-simple-indent-add-rules): Update accordingly.
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/treesit.el2
-rw-r--r--test/src/treesit-tests.el10
3 files changed, 7 insertions, 7 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 95606658a1d..ef491edf624 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1426,7 +1426,7 @@ at point to explore.
*** New variable 'treesit-aggregated-simple-imenu-settings'.
This variable allows major modes to setup Imenu for multiple languages.
-*** New function 'treesit-add-simple-indent-rules'.
+*** New function 'treesit-simple-indent-add-rules'.
This new function makes it easier to customize indent rules for
tree-sitter modes.
diff --git a/lisp/treesit.el b/lisp/treesit.el
index efc3b153ee8..30efd4d4599 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -2508,7 +2508,7 @@ RULES."
offset)))))
(cons lang (mapcar #'optimize-rule indent-rules)))))
-(defun treesit-add-simple-indent-rules (language rules &optional where anchor)
+(defun treesit-simple-indent-add-rules (language rules &optional where anchor)
"Add simple indent RULES for LANGUAGE.
This function only affects `treesit-simple-indent-rules',
diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el
index 8b24c5eb1fc..caacb74315d 100644
--- a/test/src/treesit-tests.el
+++ b/test/src/treesit-tests.el
@@ -413,21 +413,21 @@ BODY is the test body."
;;; Indent
-(ert-deftest treesit-test-add-simple-indent-rules ()
+(ert-deftest treesit-test-simple-indent-add-rules ()
"Test `treesit-add-simple-indent-rules'."
(let ((treesit-simple-indent-rules
(copy-tree '((c (a a a) (b b b) (c c c))))))
- (treesit-add-simple-indent-rules 'c '((d d d)))
+ (treesit-simple-indent-add-rules 'c '((d d d)))
(should (equal treesit-simple-indent-rules
'((c (d d d) (a a a) (b b b) (c c c)))))
- (treesit-add-simple-indent-rules 'c '((e e e)) :after)
+ (treesit-simple-indent-add-rules 'c '((e e e)) :after)
(should (equal treesit-simple-indent-rules
'((c (d d d) (a a a) (b b b) (c c c) (e e e)))))
- (treesit-add-simple-indent-rules 'c '((f f f)) :after '(b b b))
+ (treesit-simple-indent-add-rules 'c '((f f f)) :after '(b b b))
(should (equal treesit-simple-indent-rules
'((c (d d d) (a a a) (b b b) (f f f)
(c c c) (e e e)))))
- (treesit-add-simple-indent-rules 'c '((g g g)) :before '(b b b))
+ (treesit-simple-indent-add-rules 'c '((g g g)) :before '(b b b))
(should (equal treesit-simple-indent-rules
'((c (d d d) (a a a) (g g g)
(b b b) (f f f) (c c c) (e e e)))))))