GNU bug report logs - #36136
syntax-ppss fails to invalidate its cache on changes to syntax-table text properties

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; Reported by: Alan Mackenzie <acm@HIDDEN>; dated Sat, 8 Jun 2019 13:18:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at submit) by debbugs.gnu.org; 8 Jun 2019 13:17:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 08 09:17:52 2019
Received: from localhost ([127.0.0.1]:53016 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hZbEF-0006wv-NB
	for submit <at> debbugs.gnu.org; Sat, 08 Jun 2019 09:17:51 -0400
Received: from lists.gnu.org ([209.51.188.17]:45304)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1hZbEE-0006wo-1F
 for submit <at> debbugs.gnu.org; Sat, 08 Jun 2019 09:17:50 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:53934)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <acm@HIDDEN>) id 1hZbEB-0006WW-Op
 for bug-gnu-emacs@HIDDEN; Sat, 08 Jun 2019 09:17:49 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <acm@HIDDEN>) id 1hZbE9-00033Q-QZ
 for bug-gnu-emacs@HIDDEN; Sat, 08 Jun 2019 09:17:47 -0400
Received: from colin.muc.de ([193.149.48.1]:51289 helo=mail.muc.de)
 by eggs.gnu.org with smtp (Exim 4.71) (envelope-from <acm@HIDDEN>)
 id 1hZbE6-0002un-0n
 for bug-gnu-emacs@HIDDEN; Sat, 08 Jun 2019 09:17:43 -0400
Received: (qmail 62602 invoked by uid 3782); 8 Jun 2019 13:17:25 -0000
Received: from acm.muc.de (p2E5D5C7B.dip0.t-ipconnect.de [46.93.92.123]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sat, 08 Jun 2019 15:17:24 +0200
Received: (qmail 5207 invoked by uid 1000); 8 Jun 2019 13:17:24 -0000
Date: Sat, 8 Jun 2019 13:17:24 +0000
To: bug-gnu-emacs@HIDDEN
Subject: syntax-ppss fails to invalidate its cache on changes to syntax-table
 text properties
Message-ID: <20190608131724.GA4643@ACM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.10.1 (2018-07-13)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy]
X-Received-From: 193.149.48.1
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
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: -2.6 (--)

Hello, Emacs.

The syntax-ppss cache is not invalidated when syntax-table text
properties are set or cleared.  This is because the invalidation
function, syntax-ppss-flush-cache is invoked only as a before-change
function, but typical (?all) syntax-table property changes happen when
before-change-functions is inactive.

This is a bug.

In my debugging of a CC Mode scenario, a buffer change causes a
syntax-table text property change at an earlier part of the buffer.  This
is to do with the change making previously non-matching C++ raw string
identifiers match up.  Font lock follows the syntax-ppss state, which
spuriously records that the end part of the buffer is still in a string.
Hence the non-string part of the buffer is still fontified with
font-lock-string-face.

Suggested fix: the functions set_properties, add_properties,
remove_properties in textprop.c should check for changes to,
specifically, syntax-table properties.  When these changes are detected,
a hook called something like syntax-table-props-change-alert-hook should
be called (with some appropriate position parameters, tbd).
syntax-ppss-flush-cache will be added to this hook.

-- 
Alan Mackenzie (Nuremberg, Germany).




Acknowledgement sent to Alan Mackenzie <acm@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#36136; 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: Sat, 8 Jun 2019 13:30:02 UTC

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