From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Using incremental parsing in Emacs Date: Sun, 05 Jan 2020 17:10:08 -0500 Message-ID: References: <83blrkj1o1.fsf@gnu.org> <20200105141900.GA71296@breton.holly.idiocy.org> <83eewdg3vy.fsf@gnu.org> <835zhpg0fz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="137164"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii , alan@idiocy.org, emacs-devel To: yyoncho Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 05 23:10:52 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ioE6i-000ZWj-6z for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2020 23:10:48 +0100 Original-Received: from localhost ([::1]:45626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioE6h-0002bt-1b for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2020 17:10:47 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40246) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioE6D-0001u4-HU for emacs-devel@gnu.org; Sun, 05 Jan 2020 17:10:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioE6C-00079Y-4s for emacs-devel@gnu.org; Sun, 05 Jan 2020 17:10:17 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38927) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ioE67-000762-BA; Sun, 05 Jan 2020 17:10:11 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9DB3D44DA16; Sun, 5 Jan 2020 17:10:10 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7422B44DA0B; Sun, 5 Jan 2020 17:10:09 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1578262209; bh=1fNhqGsNhpjFV/MFpG8o7AqZX07x04yAEXJkt/rTCtI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=lU5vlIEsO3wypbr4ysQgQ+7s6k3m+TnzSWq7dEMrCTqED7BCcUYYBj9x0l//PG7Js i1wDdopvy3huVD1+Jbr80I8Mg71PByweIDKYku3iVXXQPaKjrrDWQY8kPqoMCI4nfB LbzW4CnnbdZcm+mPscaplFnXNXFh5+1avM86iqsz/guhXMfFCGCay6YKHYeQb/ipGP MROvTQ2w+u9pKq1PWQUd5ZjvtH4AP9n+91JrRSjDqhUB4wr+U7nGpqctXJhiYhUea/ FNeOcEMklYgPjopGgXu0jaIpo0xFt4tqjr/3aJdl52jOjiTMccXiqVoJS9NIWwoLdK N2e1s5v8vdGRQ== Original-Received: from pastel (unknown [45.72.147.220]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 292A812084D; Sun, 5 Jan 2020 17:10:09 -0500 (EST) In-Reply-To: (yyoncho@gmail.com's message of "Sun, 5 Jan 2020 23:12:56 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:244006 Archived-At: > tree-sitter seems to designed to handle that case OOTB Or rather, my proposal was based on the "standard" way incremental parsing works (e.g. syntax-ppss works the same way). > As per tree-sitter docs: > > 1. You start parsing via ts_parser_parse(in a separate thread). > 2. Document is changed > 3. Call ts_parser_set_cancellation_flag The question is how quickly this stops the parsing: any delay here is very costly because the Elisp execution will have to sit idly waiting for the parser to stop before it can continue its own execution. Stefan