anchor.diff:          (BufCnt == 0) -> State;                                    % no data, nothing to do, keep stack
           (BufBot == GuiBot) andalso (GuiCol == false) -> State;     % no new data, nothing to do, keep stack
           (GuiCnt == 0) ->                                           % (re)initialize to buffer bottom
  -            ?Debug("stack exec ~p", [integer_to_binary(Target)]),
               serve_bot(filling, integer_to_binary(Target), State#state{stack = undefined, replyToFun = ReplyTo});
           true ->
               % serve new data at the bottom of the buffer, ask client to come back
  -            ?Debug("Guicnt != 0 ~p", [integer_to_binary(Target)]),
               gui_append(#gres{state = filling, loop = integer_to_binary(Target), focus = -1}, State#state{stack = undefined, replyToFun=ReplyTo})
       end;
  -serve_stack(SN , #state{stack = Stack} = State) ->
  -    ?Debug("~p serve_stack nop~p", [SN, Stack]),
  +serve_stack(_SN , #state{stack = _Stack} = State) ->
  +    % ?Info("~p serve_stack nop~p", [_SN, _Stack]),
       State.
   
   -spec rows_after(integer(), integer(), #state{}) -> list().
  
positive.code:         (BufCnt == 0) -> State;                                    % no data, nothing to do, keep stack
          (BufBot == GuiBot) andalso (GuiCol == false) -> State;     % no new data, nothing to do, keep stack
          (GuiCnt == 0) ->                                            % (re)initialize to buffer bottom
              ?Debug("~p stack exec ~p", [autofilling,<<">|">>]),
              serve_bot(autofilling, <<">|">>, State#state{stack = undefined, replyToFun = ReplyTo});
          true ->
              % serve new data at the bottom of the buffer, ask client to come back
              ?Debug("Guicnt != 0 ~p ~p", [autofilling,<<"more">>]),
              gui_append(#gres{state = autofilling, loop = <<"more">>, focus = -1}, State#state{stack = undefined, replyToFun=ReplyTo})
      end;
  serve_stack(filling, #state{stack = {button, <<"more">>, ReplyTo}} = State) ->
  
negative.code: serve_stack( _, #state{stack=undefined}=State) ->
      % no stack, nothing .. do
      State;
  serve_stack(aborted, #state{stack={button,But,RT}}=State0) when But== <<"|<">>;But== <<"<">>;But== <<"<<">> ->
      % deferred button can be executed for backward button <<"<">> 
      serve_top(aborted,State0#state{tailLock=true,stack=undefined,replyToFun=RT});
  serve_stack(aborted, #state{stack={button,_Button,RT}}=State0) ->
      % deferred button can be executed for forward buttons <<">">> <<">>">> <<">|">> <<">|...">>
      serve_bot(aborted,<<>>,State0#state{stack=undefined,replyToFun=RT});
  
  serve_stack(completed, #state{nav=ind,bufBot=B,guiBot=B,stack={button,Button,RT}}=State0) when
        Button =:= <<">">>;
        Button =:= <<">>">>;
        Button =:= <<">|">>;
        Button =:= <<">|...">>;
        Button =:= <<"more">> ->
      serve_bot(completed,<<>>,State0#state{stack=undefined,replyToFun=RT});
  % serve_stack( _SN, #state{nav=ind,bufBot=B,guiBot=B}=State) -> 
  %     % ?Info("serve_stack at end of buffer ~p (NOP)",[B]),
  %     % gui is current at the end of the buffer, no new interesting data, nothing to do
  %     State;
  serve_stack(completed, #state{stack={button,But,RT}}=State0) when But== <<"|<">>; But== <<"<">>; But== <<"<<">> ->
      serve_top(completed,State0#state{tailLock=true,stack=undefined,replyToFun=RT});
  serve_stack(completed, #state{guiCnt=0,stack={button,<<">">>,RT}}=State0) ->
      serve_top(completed,State0#state{stack=undefined,replyToFun=RT});
  serve_stack(completed, #state{stack={button,_Button,RT}}=State0) ->
      % deferred button can be executed for forward buttons <<">">> <<">>">> <<">|">> <<">|...">>
      serve_bot(completed,<<>>,State0#state{stack=undefined,replyToFun=RT});
  
  serve_stack(filling, #state{nav=raw,stack={button,<<">">>,_},gl=GL,bufBot=BufBot,guiCnt=0}=State) when BufBot<GL ->
      % delay serving received rows, trying to get a full block for first serve
      % ?Info("skipping raw serve at ~p",[BufBot]),
      State;
  serve_stack(filling, #state{nav=ind,stack={button,<<">">>,_},gl=GL,bufBot=_BufBot,indCnt=IndCnt,guiCnt=0}=State) when IndCnt<GL ->
      % delay serving received rows, trying to get a full gui block of sorted data before first serve
      % ?Info("skipping ind serve at ~p (~p)",[_BufBot,IndCnt]),
      State;
  serve_stack(filling, #state{guiCnt=0,stack={button,<<">">>,RT}}=State0) ->
      serve_top(filling,State0#state{stack=undefined,replyToFun=RT});
  % serve_stack(SN, #state{stack={button,<<">">>,RT},bl=BL,bufBot=BufBot,guiBot=GuiBot}=State0) ->
  %     KeysBefore = keys_before(BufBot,BL-1,State0),
  %     IsMember = KeysBefore == [] orelse lists:member(GuiBot, keys_before(BufBot,BL-1,State0)),
  %     case IsMember of
  %         false ->    % deferred forward can be executed now
  %                     ?NoDbLog(debug, [], "~p stack exec ~p", [SN,<<">">>]),
  %                     ?Info("gui_append at ~p",[BufBot]),
  %                     gui_append(#gres{state=SN},State0#state{tailLock=true,stack=undefined,replyToFun=RT});
  %         true ->     ?Info("skip serve at ~p",[BufBot]),
  %                     State0#state{tailLock=true}  % buffer has not grown by 1 full block yet, keep the stack
  %     end;
  serve_stack(SN, #state{stack={button,<<"<">>,RT},bl=BL,bufTop=BufTop,guiTop=GuiTop}=State0) ->
      if
          (BufTop == GuiTop) -> State0#state{tailLock=true}; % No new data, keep the stack
  