From: Yuan Fu Date: Thu, 13 Oct 2022 21:39:51 +0000 (-0700) Subject: * src/treesit.c (Ftreesit_query_language): New function. X-Git-Tag: emacs-29.0.90~1834 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bc66ff98756fa28bbc733ef81103cac6730438fa;p=emacs.git * src/treesit.c (Ftreesit_query_language): New function. --- diff --git a/src/treesit.c b/src/treesit.c index 2b2e9c6d793..7cfcc715f9b 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -781,6 +781,16 @@ DEFUN ("treesit-query-p", return Qnil; } +DEFUN ("treesit-query-language", + Ftreesit_query_language, Streesit_query_language, 1, 1, 0, + doc: /* Return the language of QUERY. +QUERY has to be a compiled query. */) + (Lisp_Object query) +{ + CHECK_TS_COMPILED_QUERY (query); + return XTS_COMPILED_QUERY(query)->language; +} + DEFUN ("treesit-node-parser", Ftreesit_node_parser, Streesit_node_parser, 1, 1, 0, @@ -2386,6 +2396,7 @@ dynamic libraries, in that order. */); defsubr (&Streesit_node_p); defsubr (&Streesit_compiled_query_p); defsubr (&Streesit_query_p); + defsubr (&Streesit_query_language); defsubr (&Streesit_node_parser);