From: Eli Zaretskii Date: Thu, 27 Apr 2023 18:39:33 +0000 (+0300) Subject: * Makefile.in (distclean): Remove the 'native-lisp' directory. X-Git-Tag: emacs-29.0.91~93 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0cf6e0998badfa3d2d9e93791cd581f2e00fff0b;p=emacs.git * Makefile.in (distclean): Remove the 'native-lisp' directory. --- 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) distclean: $(distclean_dirs:=_distclean) clean-gsettings-schemas ${top_distclean} +ifeq ($(HAVE_NATIVE_COMP),yes) + rm -rf native-lisp +endif ### 'bootstrap-clean' ### 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." (defun treesit-query-range (node query &optional beg end) "Query the current buffer and return ranges of captured nodes. -QUERY, NODE, BEG, END are the same as in -`treesit-query-capture'. This function returns a list -of (START . END), where START and END specifics the range of each -captured node. Capture names don't matter." +QUERY, NODE, BEG, END are the same as in `treesit-query-capture'. +This function returns a list of (START . END), where START and +END specifics the range of each captured node. Capture names +generally don't matter, but names that starts with an underscore +are ignored." (cl-loop for capture in (treesit-query-capture node query beg end) + for name = (car capture) for node = (cdr capture) + if (not (string-prefix-p "_" (symbol-name name))) collect (cons (treesit-node-start node) (treesit-node-end node)))) @@ -399,6 +402,9 @@ When updating the range of each parser in the buffer, range to the range spanned by captured nodes. QUERY must be a compiled query. +Capture names generally don't matter, but names that starts with +an underscore are ignored. + QUERY can also be a function, in which case it is called with 2 arguments, START and END. It should ensure parsers' ranges are correct in the region between START and END. @@ -418,6 +424,9 @@ like this: Each QUERY is a tree-sitter query in either the string, s-expression or compiled form. +Capture names generally don't matter, but names that starts with +an underscore are ignored. + For each QUERY, :KEYWORD and VALUE pairs add meta information to it. For example,