Subject: bug#36136: closed (Re: bug#36136: Acknowledgement (syntax-ppss fails to invalidate its cache on changes to syntax-table text properties))

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 24 Aug 2019 19:36:02 +0000

Your bug report

#36136: syntax-ppss fails to invalidate its cache on changes to syntax-table text properties

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
36136: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36136
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#36136: Acknowledgement (syntax-ppss fails to invalidate its cache on changes to syntax-table text properties)
From: Alan Mackenzie <[email-masked]>
To: [email-masked]
Date: Sat, 24 Aug 2019 19:35:47 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

tags 36136 + wontfix
quit

It has been decided not to fix this bug, since it doesn't affect many
packages, and easy (though ugly) workarounds are available, principally
by the affected packages calling syntax-ppss-flush-cache.

-- 
Alan Mackenzie (Nuremberg, Germany).

Subject: syntax-ppss fails to invalidate its cache on changes to syntax-table text properties
From: Alan Mackenzie <[email-masked]>
To: [email-masked]
Date: Sat, 8 Jun 2019 13:17:24 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

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).