GNU bug report logs - #6952
jit-lock with default, small chunk-size causing incorrect fontification in cc-mode

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs,cc-mode; Reported by: Daniel Colascione <dan.colascione@HIDDEN>; Keywords: unreproducible; dated Mon, 30 Aug 2010 23:52:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) unreproducible. Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 6952 <at> debbugs.gnu.org:


Received: (at 6952) by debbugs.gnu.org; 29 Jun 2018 23:05:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 29 19:05:48 2018
Received: from localhost ([127.0.0.1]:40183 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fZ2Sa-0002qj-7k
	for submit <at> debbugs.gnu.org; Fri, 29 Jun 2018 19:05:48 -0400
Received: from mail-io0-f180.google.com ([209.85.223.180]:42350)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>)
 id 1fZ2SY-0002qP-Hc; Fri, 29 Jun 2018 19:05:47 -0400
Received: by mail-io0-f180.google.com with SMTP id r24-v6so9829120ioh.9;
 Fri, 29 Jun 2018 16:05:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=FsBCmY9VOFpZw98b1WUPSkQkYI9bRxvGWhzx1WY58Lw=;
 b=Huh830bfgqcdUbtPYIvpz+8bgoozcZ3YzfAKKqIl550CyWjnSQhcx4wa9Pzviywav0
 p+AHLR2kN77W1s6q0hDs/pZi2BsWsP0aCZ6jID502Qp98O9W/yHfAdyuybTwTQKYZA1v
 TdXu7GuWRGBq4yNpjGxoG/gQJfAA6sKingz0ltshDlJjxyeUQM9ZT25/v2S/LfICmP0+
 iJXBkjDwRF2ZieHkR4EssIe6AJgj23xRTEQnLzbNiGh4Zi62wJbChJSnDDK1ybImzcf6
 oK9XLVFGCfoJ9iRgtSAYT6sNkMzLHkcjo19tr3sh8ETvW/22jvytWK5Vi8BgS6ycFaeV
 2+Rw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=FsBCmY9VOFpZw98b1WUPSkQkYI9bRxvGWhzx1WY58Lw=;
 b=Faq6YIeVGK9M0b9QtK4FoWwGqn+ozb3CL4yu2k3pfIIHVfnAMXLU8hqKPcDLtN51V7
 zw/m89T3PKxSNnTYdAO0oGUJQJG40/yyqMj4vG5Yngj30x8VyNasVbqUY59ivyF+rd0N
 Ca9pl9ukv43muPyl31PXGt2Vx/15V1oMgFt6uZXjcLRMu1qyGBs+iDo9snSSAyyC2fQx
 2357isu23tm1yCI3QkABXIfwS7gu1yzP6UU2Dnrg0l/l5sFGIAabFpWyBgRA0xIdfq6e
 I/JT4laj+7PquvbNu/uflj6yBEjPB5IK7d874lU29zlT0X3k7s9Wt5g2Hy75/A5SLttd
 Hn3w==
X-Gm-Message-State: APt69E0svQ0kuKy7kLmGQPjubIGoIAl/R7C8x7SVPwDACjC/0vF45eiZ
 2uto/wrnxXy+Se2ZO51LYSjvfg==
X-Google-Smtp-Source: AAOMgpdJv6Aggh8EXIf1f/7kJAaQlqE+e5T7wIzXUbqsh7Xmw6WhOV9iN6WPqxulpVeJyWkFwrVDMg==
X-Received: by 2002:a6b:5a15:: with SMTP id
 o21-v6mr13129435iob.134.1530313541060; 
 Fri, 29 Jun 2018 16:05:41 -0700 (PDT)
Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id
 p67-v6sm4997935iop.40.2018.06.29.16.05.40
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Fri, 29 Jun 2018 16:05:40 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: Daniel Colascione <dan.colascione@HIDDEN>
Subject: Re: bug#6952: jit-lock with default,
 small chunk-size causing incorrect fontification in cc-mode
References: <AANLkTimUVXLtUNOGgoJ=f7XhuxvyOqKD40CO7C5Zj_Q_@HIDDEN>
Date: Fri, 29 Jun 2018 19:05:38 -0400
In-Reply-To: <AANLkTimUVXLtUNOGgoJ=f7XhuxvyOqKD40CO7C5Zj_Q_@HIDDEN>
 (Daniel Colascione's message of "Mon, 30 Aug 2010 16:52:45 -0700")
Message-ID: <87y3exmbwd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 6952
Cc: 6952 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

tags 6952 + unreproducible
quit

Daniel Colascione <dan.colascione@HIDDEN> writes:

> I've attached a file that demonstrates incorrect fontification with
> cc-mode and jit-lock used together -- the last function in the file is
> not fontified as a function when a file is first visited with
> jit-lock-chunk-size equal to its default 512.

I can't reproduce this, neither by setting jit-lock-chunk-size to 512,
nor with the default of 500.  The fontification of that file looks fine.
Tested from 24.3 to current master (27.0.50).






Information forwarded to bug-gnu-emacs@HIDDEN, bug-cc-mode@HIDDEN:
bug#6952; Package emacs,cc-mode. Full text available.

Message received at 6952 <at> debbugs.gnu.org:


Received: (at 6952) by debbugs.gnu.org; 31 Aug 2010 10:12:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 31 06:12:50 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1OqNpc-0005Wy-Iy
	for submit <at> debbugs.gnu.org; Tue, 31 Aug 2010 06:12:50 -0400
Received: from chene.dit.umontreal.ca ([132.204.246.20])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier@HIDDEN>) id 1OqNpI-0005Wj-Bm
	for 6952 <at> debbugs.gnu.org; Tue, 31 Aug 2010 06:12:42 -0400
Received: from ceviche.home (vpn-132-204-232-70.acd.umontreal.ca
	[132.204.232.70])
	by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o7VADud6028171; 
	Tue, 31 Aug 2010 06:13:56 -0400
Received: by ceviche.home (Postfix, from userid 20848)
	id 6C4E6660DF; Tue, 31 Aug 2010 12:13:55 +0200 (CEST)
From: Stefan Monnier <monnier@HIDDEN>
To: Daniel Colascione <dan.colascione@HIDDEN>
Subject: Re: bug#6952: jit-lock with default,
	small chunk-size causing incorrect fontification in cc-mode
In-Reply-To: <AANLkTimUVXLtUNOGgoJ=f7XhuxvyOqKD40CO7C5Zj_Q_@HIDDEN>
	(Daniel Colascione's message of "Mon, 30 Aug 2010 16:52:45 -0700")
Date: Tue, 31 Aug 2010 10:29:35 +0200
Message-ID: <jwvzkw3i3ye.fsf-monnier+emacs@HIDDEN>
References: <AANLkTimUVXLtUNOGgoJ=f7XhuxvyOqKD40CO7C5Zj_Q_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV3611=0
X-Spam-Score: -2.0 (--)
X-Debbugs-Envelope-To: 6952
Cc: 6952 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.0 (--)

> Presumably, the underlying cause is jit-lock asking cc-mode to start
> or stop fontification in an unexpected place.

I doubt the error is in jit-lock, because the assumptions made by
jit-lock.el are almost identical to the ones made by the non-jit-lock
code.  Jit-lock relies more heavily on some of those assumptions, tho,
so it's probably more difficult to reproduce without jit-lock, but
reproducing it without jit-lock might be the best way to debug
the problem.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN, bug-cc-mode@HIDDEN:
bug#6952; Package emacs,cc-mode. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Aug 2010 23:51:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 30 19:51:15 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1OqE8B-00012w-M4
	for submit <at> debbugs.gnu.org; Mon, 30 Aug 2010 19:51:15 -0400
Received: from mx10.gnu.org ([199.232.76.166])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <dan.colascione@HIDDEN>) id 1OqE89-00012r-Mv
	for submit <at> debbugs.gnu.org; Mon, 30 Aug 2010 19:51:14 -0400
Received: from lists.gnu.org ([199.232.76.165]:55920)
	by monty-python.gnu.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60)
	(envelope-from <dan.colascione@HIDDEN>) id 1OqE9i-0008NZ-8F
	for submit <at> debbugs.gnu.org; Mon, 30 Aug 2010 19:52:50 -0400
Received: from [140.186.70.92] (port=35218 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1OqE9g-00019H-Rg
	for bug-gnu-emacs@HIDDEN; Mon, 30 Aug 2010 19:52:49 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL
	autolearn=unavailable version=3.3.1
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <dan.colascione@HIDDEN>) id 1OqE9f-0007zb-Ob
	for bug-gnu-emacs@HIDDEN; Mon, 30 Aug 2010 19:52:48 -0400
Received: from mail-wy0-f169.google.com ([74.125.82.169]:32787)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <dan.colascione@HIDDEN>) id 1OqE9f-0007zK-KZ
	for bug-gnu-emacs@HIDDEN; Mon, 30 Aug 2010 19:52:47 -0400
Received: by wyb36 with SMTP id 36so8743610wyb.0
	for <bug-gnu-emacs@HIDDEN>; Mon, 30 Aug 2010 16:52:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:received:date:message-id
	:subject:from:to:content-type;
	bh=a1rAVMuBl86xjuvvA5fBJFiHGZV8WrQJMvk0Sc66Krk=;
	b=gU04u3P9tpy/lrVI0ZKar9gQkbM3+St4Yyp4pIm0J+sv/bF2imdtDwxxy2zXDDDA4H
	GA1zme0p2L5BhcgLYnT3U+kv4SB8wNFBbzcAYOBK/10Upkxx+vEWcS1y5I0kI4ybNCas
	oR+XYTUCWtYHaBem1AFSLcAQkWXP5yc1SvKsk=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=SXuY5ahP4o/0YZdgfqMsFeNark0vxDtJZpAA3TPBpArM5phSEQVEH8PK87wV0a0jBc
	FDmaHN9oU0E2o6TGrVxvTSf9VGCkKzV+KalDzsgh/0kNE6RiY7jJXbW0U0d7m5gl9/qr
	CF+TVSoCVxEAivsA+RrMVzpksFc9Vr4yLoK6c=
MIME-Version: 1.0
Received: by 10.216.22.203 with SMTP id t53mr5641713wet.37.1283212365950; Mon,
	30 Aug 2010 16:52:45 -0700 (PDT)
Received: by 10.216.12.73 with HTTP; Mon, 30 Aug 2010 16:52:45 -0700 (PDT)
Date: Mon, 30 Aug 2010 16:52:45 -0700
Message-ID: <AANLkTimUVXLtUNOGgoJ=f7XhuxvyOqKD40CO7C5Zj_Q_@HIDDEN>
Subject: jit-lock with default, small chunk-size causing incorrect
	fontification in cc-mode
From: Daniel Colascione <dan.colascione@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/mixed; boundary=0016364c7e373e7125048f132952
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-Spam-Score: -5.9 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.9 (-----)

--0016364c7e373e7125048f132952
Content-Type: text/plain; charset=ISO-8859-1

I've attached a file that demonstrates incorrect fontification with
cc-mode and jit-lock used together -- the last function in the file is
not fontified as a function when a file is first visited with
jit-lock-chunk-size equal to its default 512. If I change that to
32768 or change some of the whitespace in the fiile, fontification is
correct again. I've attached the file because the testcase is
whitespace-sensitive.

Presumably, the underlying cause is jit-lock asking cc-mode to start
or stop fontification in an unexpected place.

--0016364c7e373e7125048f132952
Content-Type: application/octet-stream; name="foo.c"
Content-Disposition: attachment; filename="foo.c"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gdhzh1jx0

ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAg
CiAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAg
ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAKCnR5cGUKYWJjYWJjYWJjYWJjYWJjYWJjYWJj
ICgKICAgICAgICAgICAgICB0eXBldHlwZXR5cGV0eSBwYXJhbXBhcmFtcGEsCiAgICAgICAgICAg
ICAgdHlwZXQqIHBhcmFtcGFyYW1wYXJhbSk7Cgp0eXBlCmRzZmxrYWpma2xhZmpkYXNsa2ZqYXNm
ZGQgKAogICAgICAgICAgICAgIHR5cGV0eXBldHlwZXR5IHBhcmFtcGFyYW1wYSwKICAgICAgICAg
ICAgICB0eXBldCogcGFyYW1wYXJhbXBhcmFtKTsKCnR5cGUKdmN4a3p2anhjZGZsYXNmZHNhZmR0
ICgKICAgICAgICAgdHlwZXR5cGV0eXBldHlwZXR5cGV0IHBhcmFtLAogICAgICAgICB0eXBldCBw
YXJhbXBhcmFtcCwKICAgICAgICAgdHlwZXQqIHBhcmFtcGFyYW1wYXJhbXBhCiAgICApOwoK
--0016364c7e373e7125048f132952--




Acknowledgement sent to Daniel Colascione <dan.colascione@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#6952; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 29 Jun 2018 23:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.