From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Tobias C. Rittweiler" Newsgroups: gmane.emacs.devel Subject: Re: `font-lock-extend-region-functions' vs. `font-lock-extend-after-change-region-function' Date: Fri, 01 May 2009 18:37:23 +0200 Message-ID: <873abosrss.fsf@freebits.de> 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 1241195921 16400 80.91.229.12 (1 May 2009 16:38:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 May 2009 16:38:41 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 01 18:38: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 1Lzvkt-0007VB-1u for ged-emacs-devel@m.gmane.org; Fri, 01 May 2009 18:38:31 +0200 Original-Received: from localhost ([127.0.0.1]:41922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lzvks-0000Mi-Hl for ged-emacs-devel@m.gmane.org; Fri, 01 May 2009 12:38:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lzvk7-0008Bf-Iz for emacs-devel@gnu.org; Fri, 01 May 2009 12:37:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lzvk2-000853-Uz for emacs-devel@gnu.org; Fri, 01 May 2009 12:37:43 -0400 Original-Received: from [199.232.76.173] (port=54916 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lzvk2-00084p-MN for emacs-devel@gnu.org; Fri, 01 May 2009 12:37:38 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:47504 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lzvk2-0004oC-An for emacs-devel@gnu.org; Fri, 01 May 2009 12:37:38 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Lzvjz-000517-0d for emacs-devel@gnu.org; Fri, 01 May 2009 16:37:35 +0000 Original-Received: from host145.natpool.mwn.de ([138.246.7.145]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 May 2009 16:37:35 +0000 Original-Received: from tcr by host145.natpool.mwn.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 May 2009 16:37:35 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: host145.natpool.mwn.de User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:Xz/2UH/o4zSE2Ce0JdGxZKtH1Hs= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:110589 Archived-At: Stefan Monnier writes: > 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). I'd also like if the font-lock-extend-region-functions were called with an argument counter representing the number of extend region passes so far. Of course that would be a backwards-incompatible API change but you could bind a special variable representing the count. Purpose is to guard against infinite loops. Alternatively `font-lock-default-fontify-region' could be made smarter in so far as it could check whether a pass actually changed font-lock-beg and font-lock-end, and if not, would not try another pass. (Strictly speaking the latter would also mean a slight API change, but anyone who were bitten by this should be slapped three times by some appropriately thick book anyway. :-)) -T.