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

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

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.

Why come up with complex semantic arguments when a simple `max` ensures
the right behavior regardless of other assumptions?

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

It's not needed there, no: the important part is to avoid modifying the
buffer after `end` (although, as I said, it's not terribly bad if you
do it: you'd only get burned by it in very unusual cases).

        Stefan