Implement undo-adjust-pos and undo-adjust-elt