From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: jit-lock called at EOB? Date: Fri, 29 Sep 2006 13:18:40 +0200 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1159528808 1662 80.91.229.2 (29 Sep 2006 11:20:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 29 Sep 2006 11:20:08 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 29 13:20:07 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GTGPL-0007Rm-LD for ged-emacs-devel@m.gmane.org; Fri, 29 Sep 2006 13:19:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GTGPK-0000ZK-Ur for ged-emacs-devel@m.gmane.org; Fri, 29 Sep 2006 07:19:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GTGP3-0000X0-L1 for emacs-devel@gnu.org; Fri, 29 Sep 2006 07:19:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GTGP2-0000Vy-U1 for emacs-devel@gnu.org; Fri, 29 Sep 2006 07:19:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GTGP2-0000Vs-Kg for emacs-devel@gnu.org; Fri, 29 Sep 2006 07:19:36 -0400 Original-Received: from [195.41.46.235] (helo=pfepa.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GTGUK-0007qm-RY for emacs-devel@gnu.org; Fri, 29 Sep 2006 07:25:05 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepa.post.tele.dk (Postfix) with SMTP id 40DF9FAC03F; Fri, 29 Sep 2006 13:19:35 +0200 (CEST) Original-To: Stefan Monnier In-Reply-To: (Stefan Monnier's message of "Thu\, 28 Sep 2006 10\:30\:15 -0400") 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:60306 Archived-At: Stefan Monnier writes: > The recent problems of "looping in jit-lock / redisplay" seem to be caused > by the fact that every redisplay will call jit-lock at EOB because the > text-property value of `fontified' at EOB is always nil (this is because > get-text-property treats requests at EOB specially: there is no char there, > so there can't be a property either, but instead of signalling an error it > returns nil). > > I've worked around this problem now in jit-lock by ignoring requests to > fontify empty regions of text, but I believe the real bug is in the C code > which shouldn't call jit-lock at all. So I suggest the patch below. > > Any objection? [Please ignore previous _incomplete_ message ...] Looks good to me. But I would write it like this, since there is no reason to lookup the property at eob: *** xdisp.c 20 Sep 2006 10:53:53 +0200 1.1122 --- xdisp.c 29 Sep 2006 13:15:14 +0200 *************** *** 3244,3249 **** --- 3244,3252 ---- && it->s == NULL && !NILP (Vfontification_functions) && !NILP (Vrun_hooks) + /* Ignore the special cased nil value always present at EOB since + no amount of fontifying will be able to change it. */ + && IT_CHARPOS (*it) < Z && (pos = make_number (IT_CHARPOS (*it)), prop = Fget_char_property (pos, Qfontified, Qnil), NILP (prop))) > > --- xdisp.c 22 sep 2006 11:15:42 -0400 1.1122 > +++ xdisp.c 28 sep 2006 10:28:50 -0400 > @@ -3246,7 +3246,9 @@ > && !NILP (Vrun_hooks) > && (pos = make_number (IT_CHARPOS (*it)), > prop = Fget_char_property (pos, Qfontified, Qnil), > - NILP (prop))) > + /* Ignore the special cased nil value always present at EOB since > + no amount of fontifying will be able to change it. */ > + NILP (prop) && IT_CHARPOS (*it) < Z)) > { > int count = SPECPDL_INDEX (); > Lisp_Object val; -- Kim F. Storm http://www.cua.dk