From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Wed, 1 Apr 2020 13:52:37 +0000 Message-ID: <20200401135237.GA6240@ACM> References: <83imik1qbq.fsf@gnu.org> <835zek1kpv.fsf@gnu.org> <83v9mkz5oo.fsf@gnu.org> <83pncsym6l.fsf@gnu.org> <4a9d6bb2-458d-89b0-5389-d1f883ef24a1@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="84318"; mail-complaints-to="usenet@ciao.gmane.io" Cc: akrl@sdf.org, casouri@gmail.com, Dmitry Gutov , monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 01 15:53:23 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 1jJdo3-000Lpt-9k for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Apr 2020 15:53:23 +0200 Original-Received: from localhost ([::1]:60582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJdo2-0005yP-Al for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Apr 2020 09:53:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45125) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJdnR-0005Vh-Qc for emacs-devel@gnu.org; Wed, 01 Apr 2020 09:52:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJdnN-00035g-PB for emacs-devel@gnu.org; Wed, 01 Apr 2020 09:52:45 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:22862 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1jJdnN-00033W-E3 for emacs-devel@gnu.org; Wed, 01 Apr 2020 09:52:41 -0400 Original-Received: (qmail 1999 invoked by uid 3782); 1 Apr 2020 13:52:38 -0000 Original-Received: from acm.muc.de (p4FE15C88.dip0.t-ipconnect.de [79.225.92.136]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 01 Apr 2020 15:52:37 +0200 Original-Received: (qmail 8222 invoked by uid 1000); 1 Apr 2020 13:52:37 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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:246193 Archived-At: Hello, Eli. On Wed, Apr 01, 2020 at 07:14:09 +0300, Eli Zaretskii wrote: > On April 1, 2020 6:49:45 AM GMT+03:00, Dmitry Gutov wrote: > > On 01.04.2020 05:28, Eli Zaretskii wrote: > > >> Cc: monnier@iro.umontreal.ca, casouri@gmail.com, akrl@sdf.org, > > >> emacs-devel@gnu.org > > >> From: Dmitry Gutov > > >> Date: Tue, 31 Mar 2020 22:50:43 +0300 > In general, there's no "preliminary processing" by the major mode's > fontification facilities except what happens as part of jit-lock, i.e. > at redisplay time or as side effect of functions that simulate display > for redisplay purposes. I'd be very surprised to see a major mode > which somehow preprocesses the buffer on its own in preparation for > fontification. CC Mode certainly doesn't seem to do that. CC Mode does do this. It marks syntax-table text properties throughout the buffer at find-file time, and keeps them valid thereafter in before/after-change-functions. This doesn't seem to affect starting up performance that badly. On my machine (a 3 yo AMD Ryzen) visiting xdisp.c (including the fontification of the first screenful of comments) is taking 0.18s. -- Alan Mackenzie (Nuremberg, Germany).