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

From: Dmitry Gutov <[email-masked]>
Date: Sun, 27 Mar 2016 23:27:40 +0300

On 03/27/2016 06:50 PM, Lars Magne Ingebrigtsen wrote:

> Comparison is fast, but making a copy of a buffer (or its contents)
> isn't.  (If the buffer is large, that is.)  If you've loaded a 2GB file
> and hit `M-q' on a line, it would be rather awkward if that made Emacs
> allocate an additional 2GB of data.

Compare the "current paragraph", then (its bounds can be saved at the 
beginning of the fill-paragraph).

Or track the affected area via before-change-functions.

buffer-undo-list should also have the necessary information.