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: Thu, 02 Apr 2020 09:02:41 -0400 Message-ID: References: <83369o1khx.fsf@gnu.org> <83imijz68s.fsf@gnu.org> <831rp7ypam.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="12416"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: =?utf-8?Q?Tu=E1=BA=A5n-Anh_Nguy=E1=BB=85n?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 02 15:03:32 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 1jJzVL-00039d-KS for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 15:03:31 +0200 Original-Received: from localhost ([::1]:38310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJzVK-0003iL-I3 for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 09:03:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37123) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJzUf-0003Je-8D for emacs-devel@gnu.org; Thu, 02 Apr 2020 09:02:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJzUe-0000sI-6H for emacs-devel@gnu.org; Thu, 02 Apr 2020 09:02:48 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:20582) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jJzUc-0000qG-1P; Thu, 02 Apr 2020 09:02:46 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8D89D101781; Thu, 2 Apr 2020 09:02:44 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E31481011C3; Thu, 2 Apr 2020 09:02:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1585832562; bh=S+JHlDQSo3FcA8TdX4s0xlemT4CrF659Ef5F1/1GZrQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=IpREW0UnWdWYuFINbLGh1LUO3NlZ8zXNULfYsVjy+GHcUvfylE8IwaXdRUrJbkFY8 HE+QKVn3FNxEBHmThR14Tw38PIfAC3Cwi0VKRsf8a4l9LOWFBVMT0HKMpvfGgzaPnR +3Yoc98FwGbCfk7eMMe74c16anpl0vZPSJw7gmAOWMbJhC5uJ7+qc5+6WdjvGtUAQL Rr9QFAuWwVE6u8aMbFOBDmEHQGA7fY7dCvsCKnGlMt+RkrH46xPB7DCHKY1S8RtxXY rthr1T8excQ4an3QHrU4DUoQis+uTfWRfL7cfRdEIgh6qeuiPVbTkcdvQrEavhhHiy wk87WYvEkupTw== Original-Received: from alfajor (unknown [104.247.241.114]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AF59F1201B9; Thu, 2 Apr 2020 09:02:42 -0400 (EDT) In-Reply-To: (=?utf-8?Q?=22Tu=E1=BA=A5n-Anh_Nguy=E1=BB=85n=22's?= message of "Thu, 2 Apr 2020 11:21:49 +0700") 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:246254 Archived-At: > If we really want to tackle this issue, there are other approaches to > consider, e.g. background parsing, or parsing up until a time limit, and > resume parsing when Emacs is idle. Tree-sitter's API supports the > latter. Emacs is in dire need to exploit multiple cores. It would be very natural to run tree-parser's initial parse asynchronously in a separate thread. This requires to pass tree-parser a *copy* of the buffer's text. Stefan