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 21:00:58 +0300 Message-ID: <83r1hehnz9.fsf@gnu.org> References: <86a85d26-75c0-e4a3-e8d3-244c5346dd3a@dancol.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8753"; 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 20:01:57 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 1lpx5x-000236-EP for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 20:01:57 +0200 Original-Received: from localhost ([::1]:53790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpx5w-0004Jd-BW for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 14:01:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpx56-0003aA-PO for emacs-devel@gnu.org; Sun, 06 Jun 2021 14:01:04 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55800) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpx55-0000W3-Cb; Sun, 06 Jun 2021 14:01:03 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1322 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 1lpx53-00074M-MW; Sun, 06 Jun 2021 14:01:02 -0400 In-Reply-To: (message from Stefan Monnier on Sun, 06 Jun 2021 13:44:06 -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:270490 Archived-At: > From: Stefan Monnier > Cc: Daniel Colascione , emacs-devel@gnu.org > Date: Sun, 06 Jun 2021 13:44:06 -0400 > > > Because of the order various jit-lock chunks are fontified. If the > > chunk which establishes foo as a type is fontified first, subsequent > > fontifications of foo will use font-lock-type-face. Otherwise, not. > > The way this is handled in other modes is to keep a highwater mark of > the buffer position up to which the text has been scanned for type > definitions and then in the font-lock-keywords you start by scanning the > text between this mark and the text that needs to be fontified (and > then moving the mark, of course). 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? > Indeed, there's no way currently for font-lock to tell jit-lock that it > has decided to fontify a particular chunk without being requested to do > so (Eli suggests setting the `fontified` property, but this means that > all the clients of jit-lock have done their work, so it's only correct > to set it from font-lock if you run the other `jit-lock-functions` (or > if there are currently no other `jit-lock-functions`)), By "other clients" you mean those which don't fontify, but instead piggy-back jit-lock to do other jobs?