anchor.diff:                     end
              end,
       %% Get the macros to export as case clauses.
  -    case lfe_env:fold_macros(Mfun, [], Env) of
  -        [] -> empty_leum();                     %No macros to export
  -        Macs ->
  -            %% Build case, flet and let.
  -            Case = ['case',?NAMEVAR|Macs ++ [['_',?Q(no)]]],
  -            Flr = ['letrec-function',Funs,Case],
  -            Fl = ['let',Sets,Flr],
  -            ['define-function','LFE-EXPAND-EXPORTED-MACRO',?NODOC,
  -             [lambda,[?NAMEVAR,?ARGSVAR,'$ENV'],Fl]]
  -    end.
  +    LEEM = case lfe_env:fold_macros(Mfun, [], Env) of
  +               [] -> empty_leum();              %No macros to export
  +               Macs ->
  +                   %% Build case, flet and let.
  +                   Case = ['case',?NAMEVAR|Macs ++ [['_',?Q(no)]]],
  +                   Flr = ['letrec-function',Funs,Case],
  +                   Fl = ['let',Sets,Flr],
  +                   ['define-function','LFE-EXPAND-EXPORTED-MACRO',?NODOC,
  +                    [lambda,[?NAMEVAR,?ARGSVAR,'$ENV'],Fl]]
  +           end,
  +    [{LEEM,ModLine}].
   
   empty_leum() ->
       ['define-function','LFE-EXPAND-EXPORTED-MACRO',?NODOC,
        [lambda,['_','_','_'],?Q(no)]].
  +
  +%% macro_case_clause(Name, Def) -> CaseClause.
  +%%  Build a case clause for expanding macr Name.
  +
  +macro_case_clause(Name, Def) ->
  +    Cls = get_macro_cls(Def),
  +    Ccls = [ macro_clause(Args, B) || {Args,B} <- Cls ],
  +    [?Q(Name),['case',?ARGSVAR|Ccls]].          %Don't catch errors
  +
  +%% get_macro_cls(MacroDef) -> [{ArgPat,Body}].
  +%%  Build a list of arg pattern and body for each clause. In the
  +%%  definition arguments the first is the argument pattern, the second
  +%%  is the environment variable $ENV. Be nice.
  +
  +get_macro_cls(['lambda',[Arg|_]|B]) ->
  +    [{Arg,B}];                                  %Only one clause here
  +get_macro_cls(['match-lambda'|Cls]) ->
  +    [ {Arg,B} || [[Arg|_]|B] <- Cls ];
  +get_macro_cls(_) -> [].                         %Ignore bad formed macros
  +
  +macro_clause(Args, [['when'|_]=W|Body]) ->
  +    [Args,W,[tuple,?Q(yes),[progn|Body]]];
  +macro_clause(Args, Body) ->
  +    [Args,[tuple,?Q(yes),[progn|Body]]].
   
   %% add_huf(ModLine, Forms) -> Forms.
   %%  Add the $handle_undefined_function/2 function to catch run-time
  
positive.code:     lists:foldl(fun collect_ewc_macro/2, Mst, Fs);
  collect_macro({['extend-module',_|Mdef],_}, Mst) ->
      collect_mdef(Mdef, Mst);
  collect_macro(_, Mst) -> Mst.                   %Ignore functions here.
  
  collect_ewc_macro([set,Name,Val], #umac{env=Env0}=Mst) ->
      Env1 = lfe_env:add_vbinding(Name, Val, Env0),
  
negative.code: 
  -define(NODOC, []).                             %Empty documentation
  
  %% We need these variables to have a funny name.
  -define(NAMEVAR, '|- MACRO NAME -|').
  -define(ARGSVAR, '|- CALL ARGS -|').
  
  %% Define the macro data.
  -record(umac, {mline=[],expm=[],env=[],
                 leem=false,huf=false             %Do we have leem and huf?
                }).
  
  %% module(ModuleForms, CompState) -> {ModuleForms,CompState}.
  %% module(ModuleDef, ModuleForms, UmacState, CompState) ->
  