From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Wed, 01 Apr 2020 16:25:56 -0800 Message-ID: <86pncqhgx7.fsf@stephe-leake.org> References: <83369o1khx.fsf@gnu.org> <83imijz68s.fsf@gnu.org> <831rp7ypam.fsf@gnu.org> <86wo6yhj4d.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="108948"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (windows-nt) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 02 02:27:17 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jJnhU-000SFp-Uc for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 02:27:16 +0200 Original-Received: from localhost ([::1]:60084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJnhT-0001qy-RU for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Apr 2020 20:27:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53603) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJngL-0001QH-Ez for emacs-devel@gnu.org; Wed, 01 Apr 2020 20:26:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJngJ-0000Vh-Nu for emacs-devel@gnu.org; Wed, 01 Apr 2020 20:26:04 -0400 Original-Received: from gateway33.websitewelcome.com ([192.185.145.23]:42328) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jJngJ-0000Hi-Cc for emacs-devel@gnu.org; Wed, 01 Apr 2020 20:26:03 -0400 Original-Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 738E31CC9C0 for ; Wed, 1 Apr 2020 19:26:00 -0500 (CDT) Original-Received: from host2007.hostmonster.com ([67.20.76.71]) by cmsmtp with SMTP id JngGj0m3rSl8qJngGjWV5M; Wed, 01 Apr 2020 19:26:00 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stephe-leake.org; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:To:From:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=F7bk6uXS8CUM+L6WUvQFIYHKh0o2VBoMeYqb7jMP0JQ=; b=n0620u6TUKxD5xaXuC8W0k9Zt NXV9PBztp2Or4hLycpnSB21d4upaaM+CGbEW1RL2ocu+ddEYjv1qkBU8E8aJgYOS2APCkrG1T4t3H F85Yvrzaqzf0paOFm66vuXhdlAZJCZnbm0Z+CEATV23+/trDHqlwDKcYyS+em04m3gEtR1RqP0+y8 4j06aJ/IDm+H0PirXpRFdL2PWbUlzrLih8XNAcxYjkEyOkkXB36JqzaMYmB0YB+8cgMz4JjZieHkI OsfidYyURG80hrO/VFuGIDTrwioGoKWOpf/vwh3BG+cFzwW14yyRdxCGjuw7lMEjeFkrKuRAPzfzu QPmML524w==; Original-Received: from [76.77.182.20] (port=62789 helo=Takver4) by host2007.hostmonster.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jJngF-002IhT-T8 for emacs-devel@gnu.org; Wed, 01 Apr 2020 18:25:59 -0600 In-Reply-To: <86wo6yhj4d.fsf@stephe-leake.org> (Stephen Leake's message of "Wed, 01 Apr 2020 15:38:26 -0800") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2007.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stephe-leake.org X-BWhitelist: no X-Source-IP: 76.77.182.20 X-Source-L: No X-Exim-ID: 1jJngF-002IhT-T8 X-Source-Sender: (Takver4) [76.77.182.20]:62789 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 1 X-Source-Cap: c3RlcGhlbGU7c3RlcGhlbGU7aG9zdDIwMDcuaG9zdG1vbnN0ZXIuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 192.185.145.23 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:246228 Archived-At: I looked at the tree-sitter source in git-hub (https://github.com/ubolonton/emacs-tree-sitter) and the tree-sitter doc that points to (https://tree-sitter.github.io/tree-sitter/using-parsers) Stephen Leake writes: >>> > Btw, what do you do with the tree returned by the tree-sitter parser? >>> > store it in some buffer-local variable? If so, how much memory does >>> > such a tree take, and when, if ever, is that memory released? >>> > >>> >>> It's stored in a buffer-local variable. I haven't measured the memory >>> they take. Memory is released when the tree object is garbage-collected >>> (it's a `user-ptr'). > > Is it an elisp structure (or accesible from elisp)? It's a Rust structure; there is an emacs module providing elisp access to it (things like "find syntax tree node at point", "get parent node", "get node text"). The syntax tree is a "concrete syntax tree"; it should be quite close to the wisi syntax tree. > Have you written code that traverses it to provide faces and > indentation? Not in that repository. -- -- Stephe