From: Po Lu Date: Thu, 3 Nov 2022 11:13:18 +0000 (+0800) Subject: Minor fixes to last tree-sitter change X-Git-Tag: emacs-29.0.90~1728 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6b91ea5a6159791d1d1e5006f8cbc384c0da1701;p=emacs.git Minor fixes to last tree-sitter change * src/treesit.c (treesit_find_override_name): Initialize variable. (Ftreesit_query_expand): Revert change to behavior. --- diff --git a/src/treesit.c b/src/treesit.c index 2d26f69aab5..13b49e5aacf 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -280,15 +280,14 @@ init_treesit_functions (void) The Emacs wrapper of tree-sitter does not expose everything the C API provides, most notably: - - It doesn't expose a syntax tree. The syntax tree is placed in - the parser object, and updating the tree is handled at the C - level. + - It doesn't expose a syntax tree. The syntax tree is part of the + parser object, and updating the tree is handled on the C level. - - The tree cursor is not exposed either. I think Lisp is slow - enough to nullify any performance advantage of using a cursor, - though I don't have evidence. Also I want to minimize the number - of new types we introduce. Currently we only add parser and node - type. + - It doesn't expose the tree cursor, either. Presumably, Lisp is + slow enough to make insignificant any performance advantages from + using the cursor. Not exposing the cursor also minimizes the + number of new types this adds to Emacs Lisp; currently, this adds + only the parser and node types. - Because updating the change is handled on the C level as each change is made in the buffer, there is no way for Lisp to update @@ -457,6 +456,8 @@ treesit_find_override_name (Lisp_Object language_symbol, Lisp_Object *name, CHECK_LIST (Vtreesit_load_name_override_list); + tem = Vtreesit_load_name_override_list; + FOR_EACH_TAIL (tem) { Lisp_Object lang = XCAR (XCAR (tem)); @@ -1980,7 +1981,7 @@ See Info node `(elisp)Pattern Matching' for detailed explanation. */) (Lisp_Object query) { return Fmapconcat (Qtreesit_pattern_expand, - query, empty_unibyte_string); + query, build_pure_c_string (" ")); } /* This struct is used for passing captures to be check against