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: jit-lock called at EOB? Date: Fri, 29 Sep 2006 08:58:56 -0400 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 1159534765 21661 80.91.229.2 (29 Sep 2006 12:59:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 29 Sep 2006 12:59:25 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 29 14:59:17 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 1GTHxT-0005Ld-4r for ged-emacs-devel@m.gmane.org; Fri, 29 Sep 2006 14:59:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GTHxS-0003IN-Qt for ged-emacs-devel@m.gmane.org; Fri, 29 Sep 2006 08:59:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GTHxE-0003Gy-IB for emacs-devel@gnu.org; Fri, 29 Sep 2006 08:59:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GTHxC-0003E2-Ah for emacs-devel@gnu.org; Fri, 29 Sep 2006 08:58:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GTHxC-0003Dz-5M for emacs-devel@gnu.org; Fri, 29 Sep 2006 08:58:58 -0400 Original-Received: from [209.226.175.54] (helo=tomts10-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GTI2V-0000ou-7i for emacs-devel@gnu.org; Fri, 29 Sep 2006 09:04:27 -0400 Original-Received: from localhost ([70.55.82.201]) by tomts10-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060929125857.BVKZ13241.tomts10-srv.bellnexxia.net@localhost> for ; Fri, 29 Sep 2006 08:58:57 -0400 Original-Received: by localhost (Postfix, from userid 20848) id C29D084F6; Fri, 29 Sep 2006 08:58:56 -0400 (EDT) Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: (Kim F. Storm's message of "Fri\, 29 Sep 2006 13\:18\:40 +0200") 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:60308 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? > [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: I figured that this test is the least discriminating one, so it's better to do it last. Doing it before the call to Fget_text_property will only save us a call to Fget_text_property in the rare case of EOB. The way I wrote it, it only adds a test in the case where jit-lock would normally be invoked, so the performance impact is clearly minimal. Of course, in the end I'm pretty sure neither alternative will make any difference. Stefan