Subject: Re: bug#25529: diagnosis and one approach to a fix

From: Stefan Monnier <[email-masked]>
Date: Fri, 10 Feb 2017 22:45:54 -0500

> -(defun js-syntax-propertize-regexp (end)
> +(defun js-syntax-propertize-regexp ()

Removing the `end` argument is fundamentally wrong.  It's OK to play it
fast-and-loose and ignore that argument, but the function *should* keep
the buffer untouched after `end`.

> +        (put-text-property (match-beginning 1) (match-end 1)
                                                  ^^^^^^^^^^^^^
                                              (min end (match-end 1))

should do it.

        Stefan