Subject: bug#4587: 23.1; sort-lines and sort-fields always set buffer modified

From: Stefan Monnier <[email-masked]>
Date: Wed, 30 Sep 2009 00:44:07 -0400

> M-x sort-lines and M-x sort-fields always set the buffer modified
> status ("-" -> "*" in column 5 of the status line), even if the region
> was sorted and the command did not modify anything.

Indeed.  The same holds true for fill-paragraph.

> An unmodified buffer should stay unmodified if nothing was changed.
> Reproduction:

Yes, that's generally desirable.  But in the above cases, given the way
the code currently works, it's fairly inconvenient to do (the code does
modify the buffer, it just so happens that the end text is the same as
the original text), so it doesn't seem worth the trouble.

        Stefan