anchor.diff:          {Sources} ->
               ?DEBUG("process function ~p ~n", [Prop]),
               Sources1 = lists:foldl(fun({Fun1, Source}, Acc) ->
  -                    Source1 = apply_macros(Source, Doc, AppDir),
  +                    Source0 = remove_function_name(Source),
  +                    Source1 = apply_macros(Source0, Doc, AppDir),
                       Parsed = if Source =/= Source1 ->
                               SourceId = get_source_id(Source1),
                               {Fun1, Source1, SourceId,
  
positive.code: 
  process_macros(Doc, AppDir) ->
      Funs = [<<"shows">>, <<"lists">>, <<"updates">>, <<"filters">>,
          <<"spatial">>, <<"validate_update_doc">>],
      %% apply macros too functions
      {Doc1, Objects} = process_macros_fun(Funs, Doc, [], Doc, AppDir),
      {Doc2, FinalObjects} = case couchbeam_doc:get_value(<<"views">>, Doc1) of
  
negative.code:         undefined ->
              process_macros_fun(Rest, Obj, Objects, Doc, AppDir);
          Source when is_binary(Source) ->
              Source0 = remove_function_name(Source),
              ?DEBUG("process function ~p~n", [Prop]),
              Source1 = apply_macros(Source0, Doc, AppDir),
              Obj1 = couchbeam_doc:set_value(Prop, Source1, Obj),
              Objects1 = if Source =/= Source1 ->
                      SourceId = get_source_id(Source1),
  