From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Tue, 31 Mar 2020 13:10:27 -0400 Message-ID: References: <83o8sf3r7i.fsf@gnu.org> <2E218879-0F24-4A20-B210-263C8D0BEEA4@gmail.com> <838sjh2red.fsf@gnu.org> <83369o3bvb.fsf@gnu.org> <83imik1qbq.fsf@gnu.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="82479"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: casouri@gmail.com, akrl@sdf.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 31 19:11:19 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 1jJKQ3-000LNE-Af for ged-emacs-devel@m.gmane-mx.org; Tue, 31 Mar 2020 19:11:19 +0200 Original-Received: from localhost ([::1]:41990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJKQ2-0006qY-EH for ged-emacs-devel@m.gmane-mx.org; Tue, 31 Mar 2020 13:11:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48042) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJKPV-0006Qn-V3 for emacs-devel@gnu.org; Tue, 31 Mar 2020 13:10:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJKPU-0003Do-FD for emacs-devel@gnu.org; Tue, 31 Mar 2020 13:10:45 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:35015) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jJKPR-0003Aw-Ru; Tue, 31 Mar 2020 13:10:42 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 78002100925; Tue, 31 Mar 2020 13:10:40 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id BD7CC10078F; Tue, 31 Mar 2020 13:10:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1585674638; bh=GS1S06fCFroy9XndtHj1DNiTmAGaiDfi9wEei2UJt8A=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=YOqI4oeKHPID+NiEZC+E7WVfa5uM8BZ69PZy+7zgidVLRRd+Vvn83Y/211f/Xh2Lb /My2ntwL5j85yUiN63lr0RoZXaySvmIbgIl5SNUh5TW8lEi3zTZDznSHmLfq0UUmRg l7b9id6/c2JSVYygDlOdKzI/RhVfUeDcPSWyhIF7UbZH0siH7lwb7zewUmWKo23dLt 5YitODM/yUFr8319N5TkmJJ0bW/dJxumAemWkovTD4/pnO3MsNthF7y56zYilNn0Ui 3m7lJPD7rJ5gFIHmZ0ykvaCIAuR6M+LIOTnqbxBi+IF6+2pSg9MDhOhjl6e+jj6hvS oX285A+IK33iA== Original-Received: from alfajor (unknown [104.247.241.114]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1978B12023B; Tue, 31 Mar 2020 13:10:38 -0400 (EDT) In-Reply-To: <83imik1qbq.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 31 Mar 2020 18:44:57 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 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:246125 Archived-At: >> > I still don't see why it would need the entire buffer for this class >> > of applications. Did anyone try the alternatives, in particular on >> > very large buffers? >> What alternatives? > Let tree-sitter see just a portion of the buffer, like the outer block > of what will be displayed in the window. You are saying that this is > impossible, I think it would be definitely possible if you present "from point-min to POS". But "from START to END" is much more difficult, yes. > but do tree-sitter developers also say that? You'd have to ask them. But what I say is based on the knowledge I gleaned by reading the academic literature that the tree-sitter authors cite (I did that while working on an article on SMIE ;-) In any case, your question is really about the design of tree-sitter rather than the design of the interface between tree-sitter and Emacs. AFAICT tree-sitter is pretty close to the state of the art in this area, so I think it's worth trying it out to see how it performs before considering changing its design. >> How large is "very large" here? > xdisp.c comes to mind, obviously. I'd expect tree-sitter to be able to parse xdisp.c in one second or less. Stefan