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

From: Lars Magne Ingebrigtsen <[email-masked]>
Date: Mon, 28 Mar 2016 17:39:18 +0200

Eli Zaretskii <[email-masked]> writes:

> The intervals do store the property itself, but I actually don't
> understand why should you bother discerning between faces and the
> other properties.  If the buffer text is really unchanged, the face
> properties will be identical as well, right?

[...]

> There are a couple of properties that have special meaning for fill.el
> functions, see there.
>
> However, I thought you are working on infrastructure that isn't
> supposed to be limited to what M-q does.  Was I mistaken?

Well, this is all kinda exploratory.  What's feasible to do in general,
and if nothing general can be done, can we still do something for `M-q'?

In general: It would be really nice if `buffer-modified-p' really said
whether the buffer was changed or not.  That is, load a file, add an
"a", delete the "a", and Emacs says "unchanged".  If we had that
mechanism, `M-q' would fall out naturally as a result.

But as far as I can tell, this isn't really feasible because of the way
we handle text properties: We consider some of them to change the
buffer, and some of them to not change the buffer.  And it doesn't look
like we actually store that information in the text properties
themselves.  (Please correct me if I'm wrong or you have an idea for how
to make this work.)

So on to the specific problem of `M-q' again: If we think the general
solution is a no go, would it still make sense to do the hash-the-buffer
solution just for `M-q'?  That is, does `M-q' ever change text
properties in a way that we want maintained without changing the text
itself?  I think the answer to the last question is "no", but I'm not
sure.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no