Subject: Re: master 15a76160bb: Don't throw errors while propertizing in sgml-mode

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 01 Mar 2022 16:15:38 +0100

Stefan Monnier <[email-masked]> writes:

> The PPSS really shouldn't have a negative value here.  The problem is
> that when we do as in the recipe (which does not require
> `electric-pair-mode` to reproduce), mhtml calls `sgml-syntax-propertize`
> on the `</script>` tag and the `syntax-ppss` call returns the state of
> the JS parsing at the end of the JS code rather than the state of the
> SGML parsing at the beginning of the tag.
>
> IOW it's a bug in the interaction between `mhtml` and `syntax-ppss`.

I assumed that people didn't normally get any erroring-out here because
these functions are normally called from font-locking, which catches
most errors.  When electric-pair-mode is used, the syntax functions are
called via a different code path that doesn't catch errors, so I thought
it'd make most sense to not call `error' from the code at all.

But yes, the parsing won't be correct.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no