From: Yuan Fu Date: Mon, 22 Jul 2024 00:15:44 +0000 (-0700) Subject: Fix Ftreesit_parser_create X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b252608cdc1e52e76a0a58bc596d4daa08db2b81;p=emacs.git Fix Ftreesit_parser_create * src/treesit.c (Ftreesit_parser_create): Use the buffer given by the caller rather than the current buffer. (cherry picked from commit 87f41b937bc06a14b3aeb12d5bf1a8b3e2ff74a1) --- diff --git a/src/treesit.c b/src/treesit.c index baa1b8dfd11..45db71bb5fd 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -1457,7 +1457,9 @@ an indirect buffer. */) ts_parser_set_language (parser, lang); /* Create parser. */ - Lisp_Object lisp_parser = make_treesit_parser (Fcurrent_buffer (), + Lisp_Object lisp_buf; + XSETBUFFER (lisp_buf, buf); + Lisp_Object lisp_parser = make_treesit_parser (lisp_buf, parser, NULL, language, tag);