Subject: Re: bug#13949: 24.3.50; `fill-paragraph' should not always put the buffer as modified

From: Stefan Monnier <[email-masked]>
Date: Fri, 15 Mar 2013 00:02:00 -0400

>> AFAIK there are two ways to go about it:
>> - compare the sha1 of the paragraph before and after filling and reset
>> buffer-modified-p if it shows the text hasn't changed.
> This has the disadvantage of scanning the entire buffer, which might
> increase paging and memory pressure in general.

I think you can compute the sha1 of only the paragraph, so that should
be cheap enough that it's not a big issue.

>> - change fill.el so that filling paragraph doesn't just "unfill whole
>> paragraph + fill whole paragraph" but instead goes line by line, and
>> only modifies the text where there's a need to.
> But it sounds like Dani wants this behavior not only for
> fill-paragraph, but for any command that can potentially modify the
> buffer, but actually doesn't.

While I think he'd be happy if we could do that, I didn't take his
request to be so extreme.  So even if we can't handle all cases, it
makes sense to try and improve this one case.

        Stefan