From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Thu, 2 Apr 2020 00:21:36 +0300 Message-ID: References: <83imik1qbq.fsf@gnu.org> <835zek1kpv.fsf@gnu.org> <83v9mkz5oo.fsf@gnu.org> <83pncsym6l.fsf@gnu.org> <4a9d6bb2-458d-89b0-5389-d1f883ef24a1@yandex.ru> <20200401135237.GA6240@ACM> <83d08rz48f.fsf@gnu.org> <5d5e4fac-2f83-455e-d3e0-51b28c27bfb5@yandex.ru> <837dyzyyzg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="7129"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 Cc: acm@muc.de, casouri@gmail.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, akrl@sdf.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 01 23:22:29 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 1jJkof-0001jT-Io for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Apr 2020 23:22:29 +0200 Original-Received: from localhost ([::1]:37552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJkoe-0000uc-LO for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Apr 2020 17:22:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59936) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJknv-0000M6-1I for emacs-devel@gnu.org; Wed, 01 Apr 2020 17:21:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJknt-0002ko-8q for emacs-devel@gnu.org; Wed, 01 Apr 2020 17:21:42 -0400 Original-Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:44980) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJkns-0002hY-UN; Wed, 01 Apr 2020 17:21:41 -0400 Original-Received: by mail-wr1-x441.google.com with SMTP id m17so1746186wrw.11; Wed, 01 Apr 2020 14:21:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=HkQ69zsFM45lGxpvkLDPhDQa6B7GCtBKUM5kgdi9PUU=; b=Sdt9QciV/an5lzUJ4wpRtCumbbNWLPfGKSjdyKN8P9dBmltenBIOWZnD9DPLczmuDo e4qqQNU3kD8y5gYn1TThMvKMUx3A1brNiKxTpPNlpet3NCHzZU0b8UbA82fKDI1PgSx2 Hs6ukbrYUdTgR2jK7SkXagwdcr2XWACegCfG+o6zKaKopyRyESXIFIpdAc6Eb5gH4xD4 5E7ZOwho/H3RObzogTIk31dU94JAO9nZFeimly3x+bFwjEg+gkQVtIIEp2XdZ/exFDnr KcIFwY9GceUuoPiejPYkouwBOiCqC8xAgIwgQJlIy0hFkTJVAAOg63dcGDcCz2oZ2Zmb LRkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HkQ69zsFM45lGxpvkLDPhDQa6B7GCtBKUM5kgdi9PUU=; b=eqSc5nz2hxpBqrmblGPh+/L77jfOyUF5ewAfkoupSKV8NZ/YQ762aSe++EFkB17FZ2 LAMaByH6awa+jrrmgdTjsCVKxrjhA/VDTNoS9/joZd6vaqVX3XVwnzOjjaeYs7PlzgwV blF4X08zHuDrBu+4y1wEoq8/ccXeKcKhi4Q4IYvGiZ6vM9tb0x95+kudHGoqWa9nxSx3 2uicMu5zeShVygd8gRNqhH3Nli2P2atC+TRyCsORuWjSAKV5uTyrVk6/v4w+n1mEyaK+ rLWNbruwmXifK4xiloxBI0PEAwwHPECYRiRQ5oOHk9I6Fa2169fe5Xr0rg5x/hEjmiNs qRMA== X-Gm-Message-State: ANhLgQ2mVCsf3lTGuW8Ggy8uO3hbo9Zz05o9vbB+bGzdwoC8buqYCgxt SNyIxC+KL9FNEO6ibeRRx7+ykeC2 X-Google-Smtp-Source: ADFU+vvVIx0UAdR/tZbeHm+lxMj9MpPdyUZJyY/PspLc9e1Cz64kn/YuPpVQXunZDUpChWGIxm3YJQ== X-Received: by 2002:adf:f64a:: with SMTP id x10mr27261677wrp.402.1585776098929; Wed, 01 Apr 2020 14:21:38 -0700 (PDT) Original-Received: from [192.168.0.2] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id m8sm4004950wmc.28.2020.04.01.14.21.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Apr 2020 14:21:38 -0700 (PDT) In-Reply-To: <837dyzyyzg.fsf@gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 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:246223 Archived-At: On 01.04.2020 19:03, Eli Zaretskii wrote: >> Cc:akrl@sdf.org,casouri@gmail.com,monnier@iro.umontreal.ca, >> emacs-devel@gnu.org >> From: Dmitry Gutov >> Date: Wed, 1 Apr 2020 18:27:43 +0300 >> >> On 01.04.2020 17:10, Eli Zaretskii wrote: >>> But in any case, it should be trivially obvious that avoiding to parse >>> the entire buffer will make redisplay faster. We should try doing >>> that instead of giving up, even if we think the current fontification >>> machinery is slow enough to make the parsing delay not so visible. >> I think it's pointless to argue against the current design of TreeSitter >> here, where none of its developers can read it. > If by TreeSitter you mean the parser (not the Emacs package which > interfaces it), then what I proposed is not against their design, > AFAIU. They provide an API through which we can let the parser access > the buffer text directly, and they explicitly say that the parser is > tolerant to invalid/incomplete syntax trees. And I don't see how it > could be any different, since when you start writing code, it takes > quite some time before it becomes syntactically complete and valid. That makes sense, at least in theory. But I'd rather not break the usage assumptions of the authors of this library right away. And we'll likely want to adopt existing addons which use the result of the parse, which likely depend on the same assumptions. Anyway, here's a (short) discussion on the topic of large files: https://github.com/tree-sitter/tree-sitter/issues/222