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 09:46:51 -0400 Message-ID: References: <87prewlrl9.fsf@freebits.de> <873abr211r.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 1241012872 10191 80.91.229.12 (29 Apr 2009 13:47:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Apr 2009 13:47:52 +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 15:47:43 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 1LzA8M-0003d2-JP for ged-emacs-devel@m.gmane.org; Wed, 29 Apr 2009 15:47:34 +0200 Original-Received: from localhost ([127.0.0.1]:54135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LzA8L-0006rU-TI for ged-emacs-devel@m.gmane.org; Wed, 29 Apr 2009 09:47:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LzA7l-0006bH-KE for emacs-devel@gnu.org; Wed, 29 Apr 2009 09:46:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LzA7h-0006ZY-1U for emacs-devel@gnu.org; Wed, 29 Apr 2009 09:46:57 -0400 Original-Received: from [199.232.76.173] (port=41034 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LzA7g-0006ZU-TB for emacs-devel@gnu.org; Wed, 29 Apr 2009 09:46:52 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:36245) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LzA7g-0007LW-6m for emacs-devel@gnu.org; Wed, 29 Apr 2009 09:46:52 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhsFALv290lMCpT6/2dsb2JhbACBUL1DCJBrgiUWCIEyBYU6 X-IronPort-AV: E=Sophos;i="4.40,266,1238990400"; d="scan'208";a="37756789" Original-Received: from 76-10-148-250.dsl.teksavvy.com (HELO ceviche.home) ([76.10.148.250]) by ironport2-out.teksavvy.com with ESMTP; 29 Apr 2009 09:46:51 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 72C94B5227; Wed, 29 Apr 2009 09:46:51 -0400 (EDT) In-Reply-To: <873abr211r.fsf@freebits.de> (Tobias C. Rittweiler's message of "Wed, 29 Apr 2009 12:42:56 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:110547 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. It gets worse in the other direction: if jit-lock asks font-lock to fontify 1000-1500 and font-lock decids to highlight 500-1600, the part between 500-1000 will not be redisplayed (i.e. the display will only take into account the highlighting applied by font-lock next time it gets refreshed, which usually means at the next command). Stefan