|
From: | Dmitry Gutov |
Subject: | Re: /srv/bzr/emacs/trunk r101338: * lisp/emacs-lisp/syntax.el (syntax-ppss): More sanity check to catch |
Date: | Wed, 12 Feb 2014 17:10:27 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
On 12.02.2014 16:26, Stefan Monnier wrote:
One option is to have a hook that takes a (POS . PPSS) pair, which syntax-ppss intends to use as a starting point for parsing, and return a new such pair to use instead, where the returned position should always be >= POS.A problem: suppose point is in a primary mode region, and POS is in a submode region above it. Then we can't use the value of PPSS at all.I don't understand the problem. Of course your hook would return a completely different PPSS to use along with the new buffer position from where to start parsing.
How would it calculate the returned PPSS? If the PPSS passed in is in a submode region, the primary mode won't be able to use its value.
And the hook won't have access to earlier cached values. Or would it?Or course, if the cache includes NEXT-BOUNDARY information, this situation should never happen. This'll have to be handled in the new `syntax-ppss' cache lookup logic.
Does the hook re-scan the buffer from the beginning?I don't understand the question.
If we don't have a cached value we can use, we have to `parse-partial-sexp' from the beginning of the buffer.
[Prev in Thread] | Current Thread | [Next in Thread] |