diff options
| author | Eli Zaretskii | 2023-04-27 21:39:33 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2023-04-27 21:39:33 +0300 |
| commit | 0cf6e0998badfa3d2d9e93791cd581f2e00fff0b (patch) | |
| tree | 551d4dc292c55f8afe352d5f5fa3ec0aadc6946d | |
| parent | 933705d61e58465a8a0b89a8f747c8265a9e2a81 (diff) | |
| download | emacs-0cf6e0998badfa3d2d9e93791cd581f2e00fff0b.tar.gz emacs-0cf6e0998badfa3d2d9e93791cd581f2e00fff0b.zip | |
* Makefile.in (distclean): Remove the 'native-lisp' directory.
| -rw-r--r-- | Makefile.in | 3 | ||||
| -rw-r--r-- | lisp/treesit.el | 17 |
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 | ||
| 1031 | distclean: $(distclean_dirs:=_distclean) clean-gsettings-schemas | 1031 | distclean: $(distclean_dirs:=_distclean) clean-gsettings-schemas |
| 1032 | ${top_distclean} | 1032 | ${top_distclean} |
| 1033 | ifeq ($(HAVE_NATIVE_COMP),yes) | ||
| 1034 | rm -rf native-lisp | ||
| 1035 | endif | ||
| 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 | ||
| 381 | QUERY, NODE, BEG, END are the same as in | 381 | QUERY, NODE, BEG, END are the same as in `treesit-query-capture'. |
| 382 | `treesit-query-capture'. This function returns a list | 382 | This function returns a list of (START . END), where START and |
| 383 | of (START . END), where START and END specifics the range of each | 383 | END specifics the range of each captured node. Capture names |
| 384 | captured node. Capture names don't matter." | 384 | generally don't matter, but names that starts with an underscore |
| 385 | are 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, | |||
| 399 | range to the range spanned by captured nodes. QUERY must be a | 402 | range to the range spanned by captured nodes. QUERY must be a |
| 400 | compiled query. | 403 | compiled query. |
| 401 | 404 | ||
| 405 | Capture names generally don't matter, but names that starts with | ||
| 406 | an underscore are ignored. | ||
| 407 | |||
| 402 | QUERY can also be a function, in which case it is called with 2 | 408 | QUERY can also be a function, in which case it is called with 2 |
| 403 | arguments, START and END. It should ensure parsers' ranges are | 409 | arguments, START and END. It should ensure parsers' ranges are |
| 404 | correct in the region between START and END. | 410 | correct in the region between START and END. |
| @@ -418,6 +424,9 @@ like this: | |||
| 418 | Each QUERY is a tree-sitter query in either the string, | 424 | Each QUERY is a tree-sitter query in either the string, |
| 419 | s-expression or compiled form. | 425 | s-expression or compiled form. |
| 420 | 426 | ||
| 427 | Capture names generally don't matter, but names that starts with | ||
| 428 | an underscore are ignored. | ||
| 429 | |||
| 421 | For each QUERY, :KEYWORD and VALUE pairs add meta information to | 430 | For each QUERY, :KEYWORD and VALUE pairs add meta information to |
| 422 | it. For example, | 431 | it. For example, |
| 423 | 432 | ||