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: Excessive refontification when setting jit-lock-context-unfontify-pos Date: Wed, 25 Apr 2007 00:22:20 -0400 Message-ID: References: <87bqhdaajz.fsf@neutrino.caeruleus.net> <877is1wjti.fsf@neutrino.caeruleus.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177474952 7451 80.91.229.12 (25 Apr 2007 04:22:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 Apr 2007 04:22:32 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ralf Angeli Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 25 06:22:28 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HgZ1P-0005eN-Lh for ged-emacs-devel@m.gmane.org; Wed, 25 Apr 2007 06:22:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HgZ6z-000490-3d for ged-emacs-devel@m.gmane.org; Wed, 25 Apr 2007 00:28:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HgZ6w-00048u-6Z for emacs-devel@gnu.org; Wed, 25 Apr 2007 00:28:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HgZ6u-00048i-Ln for emacs-devel@gnu.org; Wed, 25 Apr 2007 00:28:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HgZ6u-00048f-JF for emacs-devel@gnu.org; Wed, 25 Apr 2007 00:28:08 -0400 Original-Received: from bc.sympatico.ca ([209.226.175.184] helo=tomts22-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HgZ1J-0008Em-WE for emacs-devel@gnu.org; Wed, 25 Apr 2007 00:22:22 -0400 Original-Received: from pastel.home ([74.12.209.8]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070425042220.CVUF1767.tomts22-srv.bellnexxia.net@pastel.home> for ; Wed, 25 Apr 2007 00:22:20 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id EEA2B8049; Wed, 25 Apr 2007 00:22:20 -0400 (EDT) In-Reply-To: <877is1wjti.fsf@neutrino.caeruleus.net> (Ralf Angeli's message of "Tue\, 24 Apr 2007 23\:20\:41 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (gnu/linux) X-detected-kernel: Solaris 8 (1) 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:70059 Archived-At: > j-l-c-u-p seemed to be the only mechanism working reliably. In my > f-l-fontify-region-function I tried to set the f-l-multiline and > j-l-defer-multiline properties on the region in question which had no > effect. In your f-l-fontify-region-function, you should do what you'd otherwise do in f-l-extend-region: i.e. extend the region. No messing with font-lock-multiline or other properties. Just computing a new (larger) region and passing that to f-l-default-fontify-region. This is meant to make sure that if the region to highlight is part of a larger multiline-element, it will be refontified in the proper context. Then in font-lock-keywords, whenever you encounter a multiline element, you want to mark it with the font-lock-multiline property. This might work automatically if you set the font-lock-multiline to t. That should make sure that when a multiline element is later modified (possibly turning it into something completely different), it is completely refontified. That should be enough to make it all work, regardless of the use of jit-lock or even lazy-lock. If it doesn't work, please give more details, including a sample session where it fails and an explanation of how it fails. Stefan