GNU bug report logs -
#22983
syntax-ppss returns wrong result.
Previous Next
Reported by: Alan Mackenzie <acm <at> muc.de>
Date: Fri, 11 Mar 2016 15:13:02 UTC
Severity: normal
Done: Alan Mackenzie <acm <at> muc.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 03/11/2016 05:15 PM, Alan Mackenzie wrote:
> At this point, `ppss-1' and `parse' should match (apart from elements 2
> and 6). What we actually have is:
>
> ppss-1: (2 39992 nil nil nil nil 2 nil nil (39975 39992))
> parse: (0 nil 15674 34 nil nil 0 nil 15675 nil)
I think you mean that ppss-0 and ppss-1 must match independent of
narrowing, and also match (parse-partial-sexp 1 40000).
Considering narrowing can change point-min arbitrarily, specifying
(syntax-ppss pos) as (parse-partial-sexp (point-min) pos) is a losing
proposition if you want consistency.
Alas, we have some code out there that implements multiple-major-mode
functionality using narrowing and some hacking of syntax-ppss-last
syntax-ppss-cache values.
Changing syntax-ppss to be independent of narrowing will break it, and
we'll need to provide some alternative first.
We could introduce a syntax-ppss-dont-widen variable, though. Similar to
font-lock-dont-widen.
This bug report was last modified 7 years and 229 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.