From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: jit-lock doesn't honor font-lock-lines-before Date: Tue, 30 Aug 2005 22:47:28 -0400 Message-ID: <87r7cax1w0.fsf-monnier+emacs@gnu.org> References: <4311B76B.1050406@gmx.at> <43144CF6.1070505@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1125456785 16851 80.91.229.2 (31 Aug 2005 02:53:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 31 Aug 2005 02:53:05 +0000 (UTC) Cc: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 31 04:53:03 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EAIhs-0001mC-SA for ged-emacs-devel@m.gmane.org; Wed, 31 Aug 2005 04:52:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EAIm3-0002X7-1j for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2005 22:56:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EAIlI-0002DC-I8 for emacs-devel@gnu.org; Tue, 30 Aug 2005 22:55:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EAIlE-0002BI-NA for emacs-devel@gnu.org; Tue, 30 Aug 2005 22:55:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EAIlE-00029s-Ex for emacs-devel@gnu.org; Tue, 30 Aug 2005 22:55:36 -0400 Original-Received: from [209.226.175.74] (helo=tomts20-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EAIg0-0002Y4-Ox for emacs-devel@gnu.org; Tue, 30 Aug 2005 22:50:12 -0400 Original-Received: from alfajor ([67.71.117.223]) by tomts20-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050831024735.GYZT26550.tomts20-srv.bellnexxia.net@alfajor>; Tue, 30 Aug 2005 22:47:35 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 73485D73F8; Tue, 30 Aug 2005 22:47:28 -0400 (EDT) Original-To: martin rudalics In-Reply-To: <43144CF6.1070505@gmx.at> (martin rudalics's message of "Tue, 30 Aug 2005 14:11:34 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:42514 Archived-At: >>> The customizable variable `font-lock-lines-before' is not honored by >>> jit-lock mode. >> >> I know what that means in therms of what the code does, but I'm wondering in >> which circumstance it makes a visible difference to the end user. >> Do you have a test case? > Suppose not: Wouldn't that mean `font-lock-lines-before' is useless? Not at all. font-lock-lines-before has not been introduced to force refontification of the previous lines but because the N previous lines are needed as context in order to properly refontify the current line. Now the code does in fact refontify the previous lines, but it is a side-effect rather than one of the original goals. > It's not very difficult to contrive test cases for this. By default > `font-lock-multiline' is nil. `font-lock-fontify-anchored-keywords' > won't alter it - the appropriate lines have been commented out. Write > an arbitrary multiline pattern. Now font-lock won't give it the > `font-lock-multiline' text property and jit-lock not necessarily reset > its `fontified' text property after a change. `font-lock-after-change', > on the other hand, may refontify it provided `font-lock-lines-before' is > large enough. Please show me a test case. > However, I believe that `font-lock-lines-before' is a brute force > approach to handle such cases and could remarkably slow down editing if > it were honored by jit-lock mode. Multiline patterns are too delicate > and should be treated in a completely different way. Indeed, but nobody has put the work needed to handle them properly. font-lock-multiline is one hack, font-lock-lines-before is another, font-lock-fontification-face-function is yet another. Stefan