Subject: bug#861: Strange interaction of cursor movement and post-command-hook?

From: "Richard M. Stallman" <[email-masked]>
Date: Mon, 01 Sep 2008 21:09:02 -0400

Internally, the two strings share most of their state.
    The total amount of memory used is (roughly speaking)
    the memory for saved_undo_point plus the memory
    for just the string "foobar".

That is what I figured.  What I am worried about is the "roughly".
There can be a lot of undo data, which is why there are special
features to control how much is saved.  So the efficiency of storing
it is very important.

Note also that undo data covers more than just buffer contents.

    (In reality, it's a little bit fancier than what is
    described above in order to put an upper bound on
    the amount of fragmentation of strings in memory.)

Those measures, which are clearly necessary, could impact the
efficiency of storing hundreds of past snapshots.  This might cause
the amount of duplicated buffer text to increase, even drastically.
Or it might not.

Making this change to the buffer representation would not _require_
changing the undo data structure and mechanism.  That one area of the
C code is fairly modular and independent of buffer internals.
It might hardly need any change.  Other areas could take more work.