From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Daniel_Mart=C3=ADn?= Newsgroups: gmane.emacs.help Subject: Re: Hooks on treesit parse refresh Date: Tue, 28 Feb 2023 13:37:08 +0100 Message-ID: References: <87y1on63wm.fsf@meain.io> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17645"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) Cc: help-gnu-emacs@gnu.org To: Abin Simon Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 28 13:38:08 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pWzF7-0004P5-Nu for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 28 Feb 2023 13:38:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWzEY-0002Ol-G2; Tue, 28 Feb 2023 07:37:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWzER-0002OF-Ou for help-gnu-emacs@gnu.org; Tue, 28 Feb 2023 07:37:24 -0500 Original-Received: from sonic301-21.consmr.mail.ir2.yahoo.com ([77.238.176.98]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWzEP-0002ff-IB for help-gnu-emacs@gnu.org; Tue, 28 Feb 2023 07:37:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1677587830; bh=VsHUX5Ek8yJYnS+DtbO5BovYX2PpxiMi39TBO9PdMBk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=jbqedeh3y8ugbxzkLI/YuFVKdnx4eet9uqX89Ovl6T5inboaVHcoH3RHhJZ7E6AavML+DjRv3y6hZA4gcIBrKVbYLRjrDzxXqJiwaFtLVfaLbRj5jMjCvErDiOGwKNu34Bda7cE1HkKst55wd9QDmcpb5TxauC9EiHQKA5qRKddQa0ms+wxJ3KsLLKgxBP6fRM4mrryMCs50SBFcKgHSZWjEsBS9FpcZ1RvA2wk7OHEt5W8MkPIBFx1pcY3yCs5BSKXQC7UF8IH7I1jMX0b4fDYSGdXL0stQlK7r0VAW1ti7IOH6sEb89T5xaU5qcZG+46UzM1QobEezAzON39mIwA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1677587830; bh=Llk7oRPOto2UPQ1l6v+mSd3F6wenyRt8jks1NILdeVs=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=qyIyizo8jZHyoa/crSrkJRZHTuWOWRQRIjql48DAgki4xN1acRMlrSOjCJ6LCqc7NHGTD0879dW2laeST3K42+JJnuhEdrDfTamVPzqVjfwqfYmdl9jbQeP8W+W5BdcAek277p7qVL+2zO6JeAjYIkOn9UJtvlaCGx9T19XtT8Atg1POdLA3vFa9Le4oZ+rcL8grF6W2UVp7iUZ1cYdPzvHwMV4RR8drz1qPNqiQkJf2r56M/xIB0KEVtE7sFdRn9lXGeNmLaxPZSk1rncsXRN5bZzq5eB2Hy4nBQPu9RUUYvK2pZnTJLipIVDfWU8SYVywHF0W02Hg8i6D50hVPzQ== X-YMail-OSG: GgcmRakVM1nOYncd03e6o8kCC5tGghUmllvjdzFtYM5zlcCQDGXb2EAVLV7DJoh J0Dcilrs_56.9gT.ir.Ld.kBZIYKIER6CxeY2ENSmvR35vUUz37fwXlr9daIHQ3i6HsyvbB8Gyzm kD41Q04rH_.lsVuAY6EpCShgCQRBu_5yvVkoO1rBm2xFbq6UKhOcf4RsX.y9BbteQLARYqse2ve6 .mvGwJnKhAbxGjHr6Z3sMgLc8ZS4IyoEkAXbLUQ.Ng4xLWuR7O8ci3lyLRnlg.YutNqpnl.TNMN9 1WPiXVVB7yPjp.qoJFpAFKTlbZadLK8xNg9v8Hvb44BQLkC_3aB9h0sPE.miH9U_5U8oAVF11g8V bG0_.bRny1QOVzo_V3dEUNfJtpfyn42Yeioam7e.ZsptB0KEJZIsEnAJ47tuGIcKIwPi1BCVuS4G ViTXEP0zKNi8ix0cWDZKTJqcp7VlOmCev5FXRofDit8egttLRgagm43hxTtT6uf079EJga8bH8Jj wIk4uxZzsqw94gyXobA_YI8LXwv3P0jZMMn25oIzjh7HOd1k28LF1IRVisN.Aso8NK1qYGFseWTk y9VInegcxEumhK7WEbqd7Er_pa9uZ_FQaPhTU1THzRI7HJ58RtOd1c2qnkwpZdFd2mb6RyvhL2HN Pgtq2crZ8iWuiRd8xh9ccqRYARPJ.NTeucLaFP3W33DZ8GwG7IJL7pW6zOawU0qRIzzF1F6DhxqJ 6EBRwdJHnl0ZQvZoNTLKEWJBRRChr2WC.X.2vESAfPSIMsoHgaS.CGRJTmokmXFJLVuPobIMeD72 hh81reyC3AGm0TbM5nOLya52uNmMbE0l5oQjq65uOQ X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ir2.yahoo.com with HTTP; Tue, 28 Feb 2023 12:37:10 +0000 Original-Received: by hermes--production-ir2-65c64dfd66-hxbb4 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 149ee3312a92f3dfb3b31f4e392c2246; Tue, 28 Feb 2023 12:37:09 +0000 (UTC) In-Reply-To: <87y1on63wm.fsf@meain.io> (Abin Simon's message of "Fri, 24 Feb 2023 10:44:33 +0530") X-Mailer: WebService/1.1.21221 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=77.238.176.98; envelope-from=mardani29@yahoo.es; helo=sonic301-21.consmr.mail.ir2.yahoo.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142878 Archived-At: Abin Simon writes: > I was adding support for builtin treesit to one of my packages, > scopeline. https://github.com/meain/scopeline.el > > The package makes use of these hooks in elisp-tree-sitter to run when a > tree-sitter tree refresh has happened: > - tree-sitter-after-first-parse-hook > - tree-sitter-after-change-functions > > I was going through treesit code, but could not find anything > similar. `treesit-explore' seem to add a hook to `post-command-hook' but > wanted to check if there was something more specific that I could use > instead. The closest API in Emacs 29 is the concept of Tree-sitter notifiers. Read the documentation of function treesit-parser-add-notifier and friends. If this API is not sufficient for what you are trying to implement, I suggest you open a feature suggestion by sending an email to bug-gnu-emacs@gnu.org Thanks.