I have attached a patch against trunk which omits the generators, changes the data format of pending-undo-list, and addresses other comments. The undo-tests pass with this patch. As with the last patch, it doesn't solve an actual bug yet, but that is forthcoming. Since undo-tree uses primitive-undo, I think it must remain compatible. To do this and not duplicate code, I split individual element logic out to an undo-primitive-elt function and moved the look ahead at marker adjustments to undo-more. Since the latter is recent functionality, I doubt undo-tree relies on primitive-undo doing that.