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

From: Andreas Röhler <[email-masked]>
Date: Mon, 28 Mar 2016 10:09:58 +0200

On 27.03.2016 16:56, Eli Zaretskii wrote:
>> From: Óscar Fuentes <[email-masked]>
>> Date: Sun, 27 Mar 2016 05:31:19 +0200
>> Cc: Jaakov <[email-masked]>, [email-masked]
>>
>> diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
>> index 100e2a2..9e1f430 100644
>> --- a/lisp/textmodes/fill.el
>> +++ b/lisp/textmodes/fill.el
>> @@ -804,6 +804,7 @@ fill-paragraph
>>     (interactive (progn
>>   		 (barf-if-buffer-read-only)
>>   		 (list (if current-prefix-arg 'full) t)))
>> +  (setq h (if (buffer-modified-p) "" (secure-hash 'md5 (current-buffer))))
>>     (or
>>      ;; 1. Fill the region if it is active when called interactively.
>>      (and region transient-mark-mode mark-active
>> @@ -862,7 +863,10 @@ fill-paragraph
>>                        ;; fill-region.
>>                        (fill-region beg end justify)
>>                      (fill-region-as-paragraph beg end justify))))))
>> -     fill-pfx)))
>> +     fill-pfx))
>> +  (when (and (not (string= h ""))
>> +             (string= h (secure-hash 'md5 (current-buffer))))
>> +    (set-buffer-modified-p nil)))
> Thanks, but I'm not sure computing the hash is enough: the functions
> involved in refilling can change text properties, so the test should
> also account for that.
>
>
>

Maybe restrict the notion of changes here to all values, which an 
auto-save would store?