aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2023-04-27 21:39:33 +0300
committerEli Zaretskii2023-04-27 21:39:33 +0300
commit0cf6e0998badfa3d2d9e93791cd581f2e00fff0b (patch)
tree551d4dc292c55f8afe352d5f5fa3ec0aadc6946d
parent933705d61e58465a8a0b89a8f747c8265a9e2a81 (diff)
downloademacs-0cf6e0998badfa3d2d9e93791cd581f2e00fff0b.tar.gz
emacs-0cf6e0998badfa3d2d9e93791cd581f2e00fff0b.zip
* Makefile.in (distclean): Remove the 'native-lisp' directory.
-rw-r--r--Makefile.in3
-rw-r--r--lisp/treesit.el17
2 files changed, 16 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in
index 8b77aac38cd..f5fda0eb61a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1030,6 +1030,9 @@ $(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),distclean)
1030 1030
1031distclean: $(distclean_dirs:=_distclean) clean-gsettings-schemas 1031distclean: $(distclean_dirs:=_distclean) clean-gsettings-schemas
1032 ${top_distclean} 1032 ${top_distclean}
1033ifeq ($(HAVE_NATIVE_COMP),yes)
1034 rm -rf native-lisp
1035endif
1033 1036
1034### 'bootstrap-clean' 1037### 'bootstrap-clean'
1035### Delete everything that can be reconstructed by 'make' and that 1038### Delete everything that can be reconstructed by 'make' and that
diff --git a/lisp/treesit.el b/lisp/treesit.el
index e718ea1a23a..1d4749c8cd2 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -378,13 +378,16 @@ See `treesit-query-capture' for QUERY."
378(defun treesit-query-range (node query &optional beg end) 378(defun treesit-query-range (node query &optional beg end)
379 "Query the current buffer and return ranges of captured nodes. 379 "Query the current buffer and return ranges of captured nodes.
380 380
381QUERY, NODE, BEG, END are the same as in 381QUERY, NODE, BEG, END are the same as in `treesit-query-capture'.
382`treesit-query-capture'. This function returns a list 382This function returns a list of (START . END), where START and
383of (START . END), where START and END specifics the range of each 383END specifics the range of each captured node. Capture names
384captured node. Capture names don't matter." 384generally don't matter, but names that starts with an underscore
385are ignored."
385 (cl-loop for capture 386 (cl-loop for capture
386 in (treesit-query-capture node query beg end) 387 in (treesit-query-capture node query beg end)
388 for name = (car capture)
387 for node = (cdr capture) 389 for node = (cdr capture)
390 if (not (string-prefix-p "_" (symbol-name name)))
388 collect (cons (treesit-node-start node) 391 collect (cons (treesit-node-start node)
389 (treesit-node-end node)))) 392 (treesit-node-end node))))
390 393
@@ -399,6 +402,9 @@ When updating the range of each parser in the buffer,
399range to the range spanned by captured nodes. QUERY must be a 402range to the range spanned by captured nodes. QUERY must be a
400compiled query. 403compiled query.
401 404
405Capture names generally don't matter, but names that starts with
406an underscore are ignored.
407
402QUERY can also be a function, in which case it is called with 2 408QUERY can also be a function, in which case it is called with 2
403arguments, START and END. It should ensure parsers' ranges are 409arguments, START and END. It should ensure parsers' ranges are
404correct in the region between START and END. 410correct in the region between START and END.
@@ -418,6 +424,9 @@ like this:
418Each QUERY is a tree-sitter query in either the string, 424Each QUERY is a tree-sitter query in either the string,
419s-expression or compiled form. 425s-expression or compiled form.
420 426
427Capture names generally don't matter, but names that starts with
428an underscore are ignored.
429
421For each QUERY, :KEYWORD and VALUE pairs add meta information to 430For each QUERY, :KEYWORD and VALUE pairs add meta information to
422it. For example, 431it. For example,
423 432