bug#81611: 31.0.90; show-paren-mode reports false mismatch

Eli Zaretskii <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
> Cc: [email protected]
> Date: Wed, 12 Aug 2026 15:50:24 -0400
> From: Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email protected]>
> 
> > Suggested fix: Before narrowing, check syntax-ppss at the cutoff; if it
> > is inside a string or comment, don't cut there -- but snap forward (or
> > backward) to a position outside strings/comments.
> 
> +1
> 
> And I believe the "snap forward" can be done by `parse-partial-sexp` with
> COMMENTSTOP arg of `syntax-table`.  The snap backward is simpler (just
> jump to (nth 8 ppss)), but could jump very far back if the
> string/comment is very long.

Wouldn't syntax-ppss run the risk of going far back?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.