emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thinking about changed buffers


From: Stefan Monnier
Subject: Re: Thinking about changed buffers
Date: Tue, 29 Mar 2016 09:39:54 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> The only solution I can see for fill-paragraph is to copy the paragraph to
> a temp buffer, fill that, check whether it has changed, then if it has,
> signal before-change, copy the changed paragraph back, signal after
> change. If it has not changed, then fill-paragraph becomes a no-op.

BTW, another solution for fill-paragraph is to reimplement it from
scratch such that it doesn't "unfill+refill".  I.e. it could instead
loop go to each LF in the paragraph, such if that LF is found to be "at
the right spot", it moves on, if it's "too soon", then it removes it,
and if it's "too far" then it adds another somewhere earlier.

This would naturally lead to the result that the buffer would stay
unmodified if there was no change.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]