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

From: Tom Tromey <[email-masked]>
Date: Fri, 10 Feb 2017 21:06:20 -0700

>>>>> "Stefan" == Stefan Monnier <[email-masked]> writes:

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

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

I thought it was ok because the region is always extended to the end of
the line, and I think this regexp can't span lines.

>> +        (put-text-property (match-beginning 1) (match-end 1)
Stefan>                                                   ^^^^^^^^^^^^^
Stefan>                                               (min end (match-end 1))
Stefan> should do it.

If this change is still needed, should the final goto-char also be
treated this way?

Tom