|
From: | Dmitry Gutov |
Subject: | bug#41522: 26.3; Narrowing can prevent syntax propertization |
Date: | Mon, 25 May 2020 18:04:01 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
Hi! On 25.05.2020 11:42, Ikumi Keita wrote:
In a similar way, if a lisp function goes to the point where syntax propertization has not yet took place, makes narrowing and calls some syntax-aware function which sets `syntax-propertize--done' to a value inside the narrowing, a large portion of the buffer can be left without suitable `syntax-table' property. This can lead to incorrect result for not only font-lock but also syntax-aware functions such as `forward-comment'.
Our current stance on the matter is that, in the simple case, code should call syntax-ppss from "widened" state. And the code which doesn't should be fixed. Or if it really need to do that (for some reason), it should take care to handle any undesired sife-effects itself.
See the definition of syntax-ppss-wide, which contains caches for both narrowed and "wide" syntax states.
[Prev in Thread] | Current Thread | [Next in Thread] |