From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.devel Subject: Re: emacs-tree-sitter and Emacs Date: Thu, 02 Apr 2020 10:27:23 -0400 Message-ID: <87pncq55f8.fsf@md5i.com> References: <83eeta3sa0.fsf@gnu.org> <86369ojbig.fsf@stephe-leake.org> <83lfnfz6jr.fsf@gnu.org> <864ku3htmb.fsf@stephe-leake.org> <83v9mix9vk.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="30997"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Stephen Leake , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 02 16:29:27 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 1jK0qT-0007xT-UG for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 16:29:25 +0200 Original-Received: from localhost ([::1]:40924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK0qS-0004zQ-VZ for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 10:29:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59295) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK0oa-0002sm-H5 for emacs-devel@gnu.org; Thu, 02 Apr 2020 10:27:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jK0oZ-0003zk-IY for emacs-devel@gnu.org; Thu, 02 Apr 2020 10:27:28 -0400 Original-Received: from md5i.com ([75.151.244.229]:56578) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jK0oX-0003xg-AM; Thu, 02 Apr 2020 10:27:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: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=g8wMtTHUlw070u2MeIK5oIfjY01EACImvF2QRfGmpr8=; b=Ze7PtIY18HxyOBJHTr1wA3PS6g lTV8LGFfWj/8PXfySzLQNElnzxadDBJhlM5AqZCNYiuSqsHJyebao5Kk8+E8sUUA+HzXE2y2RgBOf N2z+FGF1N8aCc84a7871Jfa5i; Original-Received: from md5i by md5i.com with local (Exim 4.93) (envelope-from ) id 1jK0oV-00Byrt-Kr; Thu, 02 Apr 2020 10:27:23 -0400 In-Reply-To: <83v9mix9vk.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 02 Apr 2020 17:03:43 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 75.151.244.229 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:246260 Archived-At: Eli Zaretskii writes: >> From: Stephen Leake >> Date: Wed, 01 Apr 2020 11:51:40 -0800 >> >> Eli Zaretskii writes: >> >> > Can you tell in more detail why you need to rely on these hooks? They >> > shouldn't be necessary, AFAIU. >> >> It is an optimization choice. >> >> In an unmodified buffer, that is smaller than 100,000 characters >> (default setting of wisi-partial-parse-threshold), the entire buffer is >> parsed once; that applies faces to all the Ada identifiers that need >> faces (standard font-lock regexp handles the reserved words). Then when >> font-lock fontifies a region, no parsing is needed. > > But why do you need that initial full parse in the first place? Is > parsing parts of the buffer so much harder? I would think that you at least need to parse everything displayed and everything before what is displayed. (You need all prior context. What if someone opened a comment on line 1 and hasn't closed it, for example?) I don't, however, see a reason you couldn't defer sending the rest until afterward, any more than you would have to if the file were being typed in, one line at a time. -- Michael Welsh Duggan (md5i@md5i.com)