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: `font-lock-extend-region-functions' vs. `font-lock-extend-after-change-region-function' Date: Wed, 29 Apr 2009 16:26:38 -0400 Message-ID: References: <87prewlrl9.fsf@freebits.de> <873abr211r.fsf@freebits.de> <87ocufz7d5.fsf@freebits.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1241036860 20891 80.91.229.12 (29 Apr 2009 20:27:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Apr 2009 20:27:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Tobias C. Rittweiler" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 29 22:27:32 2009 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 1LzGNM-0002VP-EK for ged-emacs-devel@m.gmane.org; Wed, 29 Apr 2009 22:27:28 +0200 Original-Received: from localhost ([127.0.0.1]:32853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LzGNL-0001Hz-GK for ged-emacs-devel@m.gmane.org; Wed, 29 Apr 2009 16:27:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LzGN4-00019N-H3 for emacs-devel@gnu.org; Wed, 29 Apr 2009 16:27:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LzGN3-00018g-Vy for emacs-devel@gnu.org; Wed, 29 Apr 2009 16:27:10 -0400 Original-Received: from [199.232.76.173] (port=46383 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LzGN3-00018b-Ii for emacs-devel@gnu.org; Wed, 29 Apr 2009 16:27:09 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:54864) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LzGN3-0001Ls-5X for emacs-devel@gnu.org; Wed, 29 Apr 2009 16:27:09 -0400 Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n3TKQdf0026231; Wed, 29 Apr 2009 16:26:39 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 55A0E3A96D; Wed, 29 Apr 2009 16:26:38 -0400 (EDT) In-Reply-To: <87ocufz7d5.fsf@freebits.de> (Tobias C. Rittweiler's message of "Wed, 29 Apr 2009 19:40:06 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3264=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:110559 Archived-At: >> > But the new region that EXTEND is called with begins at 523, and not 701 >> > even though we processed the region between 523 and 701 already. >> > This seems more inefficient than it needs to be if I'm not missing >> > anything. >> You're not missing anything. It's an inefficiency in jit-lock, indeed. >> jit-lock asks font-lock to highlight 1-523 and font-lock has no way to >> tell jit-lock that the first call already highlighted 1-701, so next >> time jit-lock needs highlighting it will do 523-1034 because it doesn't >> know that 523-701 was done already. > Is this intended to be fixed? For example, the extending of the > font-lock region could be made a seperate step which > `jit-lock-fontify-now' has to run explicitly. Yes. This problem was introduced in Emacs-22 but at the time I decided it was better to "keep it that way for now" (the freeze was coming) and fix it for Emacs-23, but I never got around to do it. The way I imagine fixing it is by changing jit-lock-functions such that the functions on that hook (e.g. font-lock-fontify-region) would return the new boundaries they used (or nil if they kept the boundaries passed by jit-lock). Stefan