In primitive-undo in simple.el, aroud line 2550 (in master) we adjust the markers after the insertion. (dolist (adj valid-marker-adjustments) (set-marker (car adj) (- (car adj) (cdr adj)))) Why is this needed? Won't insert take care of adjusting the markers?