core_pattern_match: use begin/end_user_action instead of begin/end_not_undoable_action