From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: cc-mode fontification feels random Date: Sun, 06 Jun 2021 22:03:08 +0300 Message-ID: <83lf7mhl3n.fsf@gnu.org> References: <86a85d26-75c0-e4a3-e8d3-244c5346dd3a@dancol.org> <83r1hehnz9.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29349"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, dancol@dancol.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 06 21:03:47 2021 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 1lpy3n-0007Ki-99 for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 21:03:47 +0200 Original-Received: from localhost ([::1]:47518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpy3l-0008AS-TM for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 15:03:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpy3F-0007T7-60 for emacs-devel@gnu.org; Sun, 06 Jun 2021 15:03:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57810) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpy3E-0006hI-LK; Sun, 06 Jun 2021 15:03:12 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1253 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpy3E-0004Mg-5W; Sun, 06 Jun 2021 15:03:12 -0400 In-Reply-To: (message from Stefan Monnier on Sun, 06 Jun 2021 14:18:15 -0400) 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:270498 Archived-At: > From: Stefan Monnier > Cc: acm@muc.de, dancol@dancol.org, emacs-devel@gnu.org > Date: Sun, 06 Jun 2021 14:18:15 -0400 > > > So if the first windowful of a file that's displayed is at EOB, > > fontification must go all the way back to BOB and start scanning > > there, until it comes to the end? > > Yup. The way to make it bearable is to make that scan be as simple and > fast as possible. > > Note that `syntax-propertize` and `syntax-ppss` also work this way, so > it's already the case that when we start by displaying EOB we first have > to apply `syntax-propertize` over the whole buffer :-( What exactly are the reasons that we need to scan from BOB? With the exception of data type declarations, what else requires to go back farther that the beginning of the defun in which we start fontifying?