anchor.diff:  	    terminate(Class, NewReason, Stacktrace, NewDebug, NewS, Q);
   	{next_state,NextState,NewData} ->
   	    loop_event_actions(
  -	      Parent, Debug, S, Events, Event,
  -	      State, NextState, NewData, []);
  +	      Parent, Debug, S, Events,
  +	      State, NewData, P, Event, NextState, []);
   	{next_state,NextState,NewData,Actions} ->
   	    loop_event_actions(
  -	      Parent, Debug, S, Events, Event,
  -	      State, NextState, NewData, Actions);
  +	      Parent, Debug, S, Events,
  +	      State, NewData, P, Event, NextState, Actions);
   	{keep_state,NewData} ->
   	    loop_event_actions(
  -	      Parent, Debug, S, Events, Event,
  -	      State, State, NewData, []);
  +	      Parent, Debug, S, Events,
  +	      State, NewData, P, Event, State, []);
   	{keep_state,NewData,Actions} ->
   	    loop_event_actions(
  -	      Parent, Debug, S, Events, Event,
  -	      State, State, NewData, Actions);
  +	      Parent, Debug, S, Events,
  +	      State, NewData, P, Event, State, Actions);
   	keep_state_and_data ->
   	    loop_event_actions(
  -	      Parent, Debug, S, Events, Event,
  -	      State, State, Data, []);
  +	      Parent, Debug, S, Events,
  +	      State, Data, P, Event, State, []);
   	{keep_state_and_data,Actions} ->
   	    loop_event_actions(
  -	      Parent, Debug, S, Events, Event,
  -	      State, State, Data, Actions);
  +	      Parent, Debug, S, Events,
  +	      State, Data, P, Event, State, Actions);
   	_ ->
  +	    NewS = S#{state := State, data := Data, postponed := P},
  +	    Q = [Event|Events],
   	    ?TERMINATE(
  -	      error, {bad_return_value,Result}, Debug, S, [Event|Events])
  +	      error, {bad_return_value,Result}, Debug, NewS, Q)
       end.
   
   loop_event_actions(
  -  Parent, Debug, S, Events, Event, State, NextState, NewData, Actions) ->
  -    Postpone = false, % Shall we postpone this event, true or false
  +  Parent, Debug, S, Events, State, NewData, P, Event, NextState, Actions) ->
  +    Postpone = false, % Shall we postpone this event; boolean()
       Hibernate = false,
       Timeout = undefined,
       NextEvents = [],
       loop_event_actions(
  -      Parent, Debug, S, Events, Event, State, NextState, NewData,
  +      Parent, Debug, S, Events, State, NewData, P, Event, NextState,
         if
   	  is_list(Actions) ->
   	      Actions;
  
positive.code: 			    _ ->
  				{info,Msg}
  			end,
  		    loop_event(Parent, Debug, S, Event)
  	    end
      end.
  
  loop_event(Parent, Debug, S, Event) ->
      %% The timer field and the hibernate flag in S
      %% are now invalid and ignored until we get back to loop/3
      NewDebug = sys_debug(Debug, S, {in,Event}),
      %% Here the queue of not yet processed events is created
      loop_events(Parent, NewDebug, S, [Event], false).
  
  %% Process first the event queue, or if it is empty
  %% loop back to receive a new event
  loop_events(Parent, Debug, S, [], _Hibernate) ->
      loop(Parent, Debug, S);
  loop_events(
    Parent, Debug,
    #{callback_mode := CallbackMode,
      module := Module,
      state := State,
      data := Data} = S,
    [{Type,Content} = Event|Events] = Q,
    Hibernate) ->
      %% If the Hibernate flag is true here it can only be
      %% because it was set from an event action
      %% and we did not go into hibernation since there
      %% were events in queue, so we do what the user
  
negative.code: 	%% * Postponing the current event is performed
  	%%   iff 'postpone' is 'true'.
  	%% * A state timer is started iff 'timeout' is set.
  	%% * Pending events are handled or if there are
  	%%   no pending events the server goes into receive
  	%%   or hibernate (iff 'hibernate' is 'true')
  	%%
  