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: emacs-tree-sitter and Emacs Date: Thu, 02 Apr 2020 18:16:48 -0800 Message-ID: <86y2rdfh4f.fsf@stephe-leake.org> References: <83eeta3sa0.fsf@gnu.org> <86369ojbig.fsf@stephe-leake.org> <83lfnfz6jr.fsf@gnu.org> <864ku3htmb.fsf@stephe-leake.org> <83v9mix9vk.fsf@gnu.org> <87pncq55f8.fsf@md5i.com> <83imihyl42.fsf@gnu.org> <83h7y1yikx.fsf@gnu.org> <82EC720F-CED9-45E6-813B-FD326A9E7651@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="73047"; 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 Fri Apr 03 04:18:55 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 1jKBv4-000Iux-NL for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Apr 2020 04:18:54 +0200 Original-Received: from localhost ([::1]:49396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKBv3-0004lE-Na for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 22:18:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32911) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKBuZ-0004Kg-S0 for emacs-devel@gnu.org; Thu, 02 Apr 2020 22:18:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jKBuY-00020o-8d for emacs-devel@gnu.org; Thu, 02 Apr 2020 22:18:23 -0400 Original-Received: from gateway22.websitewelcome.com ([192.185.47.48]:37708) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jKBuX-0001zy-QO for emacs-devel@gnu.org; Thu, 02 Apr 2020 22:18:22 -0400 Original-Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway22.websitewelcome.com (Postfix) with ESMTP id A4936E487 for ; Thu, 2 Apr 2020 21:16:54 -0500 (CDT) Original-Received: from host2007.hostmonster.com ([67.20.76.71]) by cmsmtp with SMTP id KBt8jX0RIXVkQKBt8jlZuc; Thu, 02 Apr 2020 21:16:54 -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-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:To:From:Sender: Reply-To:Cc: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=YLeGHJZFAOrAQE1aynFaYnDwo9DrUmUEu12BCMx7yOo=; b=moNrkj25RWRmqQCCbj+K0YwKnZ apPYGpy4Pf9dIuhEQCKta/N+CX2rY6Ta0cIReSMwPRR+WjsZy54NiumluCI1jR6K9Kx4lmD08p0i+ zvuiiKXcQ9DMOlfnVOpcEeJh16G0A8FPeOTIUTfikkQ55jHPWsU9CozrihftL04tOSLAY4aBqdA6J aZYnFEOhv6gFCbarJUH1JTeCh5XS/YmhJo0LrXOShdZwczf/YM8EBd2VbWq+7mM3zJhAGS+vSm945 7UQzgwAd/qbqt5DEgaUklICW9AKRzE+UT+E1GwMm8hes7BOsJugDtZuP+HZxyuCclAP6mV2Ls+Tvz aOJTRlNQ==; Original-Received: from [76.77.182.20] (port=63751 helo=Takver4) by host2007.hostmonster.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jKBt7-002wNL-RQ for emacs-devel@gnu.org; Thu, 02 Apr 2020 20:16:53 -0600 In-Reply-To: <82EC720F-CED9-45E6-813B-FD326A9E7651@gmail.com> (Yuan Fu's message of "Thu, 2 Apr 2020 14:17:22 -0400") 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: 1jKBt7-002wNL-RQ X-Source-Sender: (Takver4) [76.77.182.20]:63751 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 2 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.47.48 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:246296 Archived-At: Yuan Fu writes: >> you have two windows displaying a large buffer, one display near the end, >> and the other near the beginning, and you make changes at the beginning >> of the buffer. I haven't seen any performance bug-reports or complaints >> about it, so it appears that those circumstances are very rare. > > Or you open a buffer and jumps to point-max, which I assume isn=E2=80=99t= that > rare. OTOH if the whole buffer has been parsed, this two-window setup > shouldn=E2=80=99t be slow when making changes because incremental parsing= is > fast, and we don=E2=80=99t need to re-parse the whole buffer. That assumes that changes in syntax before (or after) a point don't affect fontification at that point. That depends on the language being fontified. As has been mentioned several times, inserting a block comment start violates that assumption (if the language has those; Ada doesn't), as does inserting an open string quote (if the string is not closed by line end; it is in Ada, but that's not supported in Emacs). There are smaller cases; in ada-mode, a name like Package_1.Function_1 has different faces for the parts before and after the dot. So the fontification of "Package" depends on the presence of ".", which comes after. I assume tree-sitter gets this right; it should parse from the inserted block comment start to the end of the file, even though the text change message did not include all of that. --=20 -- Stephe