GNU bug report logs -
#36136
syntax-ppss fails to invalidate its cache on changes to syntax-table text properties
Previous Next
Reported by: Alan Mackenzie <acm <at> muc.de>
Date: Sat, 8 Jun 2019 13:18:01 UTC
Severity: normal
Tags: wontfix
Done: Alan Mackenzie <acm <at> muc.de>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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).
This bug report was last modified 5 years and 266 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.