--- Begin Message ---
Subject: |
syntax-ppss fails to invalidate its cache on changes to syntax-table text properties |
Date: |
Sat, 8 Jun 2019 13:17:24 +0000 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
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).
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#36136: Acknowledgement (syntax-ppss fails to invalidate its cache on changes to syntax-table text properties) |
Date: |
Sat, 24 Aug 2019 19:35:47 +0000 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
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).
--- End Message ---