properly enable undo by buffer-enable-undo