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: jit-lock called at EOB? Date: Thu, 28 Sep 2006 10:30:15 -0400 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1159454489 3354 80.91.229.2 (28 Sep 2006 14:41:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 28 Sep 2006 14:41:29 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 28 16:41:26 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 1GSx4D-0003jH-Ck for ged-emacs-devel@m.gmane.org; Thu, 28 Sep 2006 16:40:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GSx4C-0007Ca-Te for ged-emacs-devel@m.gmane.org; Thu, 28 Sep 2006 10:40:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GSx3c-0006kE-74 for emacs-devel@gnu.org; Thu, 28 Sep 2006 10:40:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GSx3X-0006fN-9p for emacs-devel@gnu.org; Thu, 28 Sep 2006 10:40:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GSx3X-0006f9-28 for emacs-devel@gnu.org; Thu, 28 Sep 2006 10:40:07 -0400 Original-Received: from [209.226.175.25] (helo=tomts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GSx8d-0004gr-4n for emacs-devel@gnu.org; Thu, 28 Sep 2006 10:45:23 -0400 Original-Received: from localhost ([70.55.82.201]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060928144005.LICJ18394.tomts5-srv.bellnexxia.net@localhost> for ; Thu, 28 Sep 2006 10:40:05 -0400 Original-Received: by localhost (Postfix, from userid 20848) id 02F1D8155; Thu, 28 Sep 2006 10:30:15 -0400 (EDT) Original-To: emacs-devel@gnu.org 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:60294 Archived-At: 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? Stefan --- 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;