anchor.diff:  	_ -> {Tree, false}
       end.
   
  -
  +gen_fun_clause(FileName, ParName, FunName, Arity, DefPos, Exp, TabWidth, SideEffect) ->
  +    {ok, {AnnAST, Info}} = refac_util:parse_annotate_file(FileName,true, [],TabWidth),  
  +    {ok, ModName} = get_module_name(Info),
  +    Forms = refac_syntax:form_list_elements(AnnAST),
  +    Exp1 = make_actual_parameter(ModName, Exp, SideEffect),
  +    F = fun(Form) ->
  +		case refac_syntax:type(Form) of 
  +		    function -> case get_fun_def_loc(Form) of 
  +				    DefPos -> 
  +					NewPar= refac_syntax:variable(ParName),
  +					Cs = refac_syntax:function_clauses(Form),
  +					Cs1 = [replace_clause_body(C, FunName, Arity, Exp, Exp1, Info) || C <-Cs],
  +					Form1 = refac_syntax:copy_attrs(Form, refac_syntax:function(refac_syntax:atom(FunName), Cs1)),
  +					ClauseToGen = hd(lists:filter(fun(C) -> {EStart, EEnd} = refac_util:get_range(Exp),
  +										{CStart, CEnd} = refac_util:get_range(C),
  +										(CStart =< EStart) andalso (EEnd =< CEnd)
  +								      end, Cs)),
  +					ClauseToGen1 =add_actual_parameter(replace_exp_with_var(ClauseToGen, {ParName, Exp, SideEffect}),
  +									   {FunName, Arity , NewPar, Info}),
  +					ClauseToGen2 = add_parameter(ClauseToGen1, NewPar),
  +					NewForm = refac_syntax:function(refac_syntax:atom(FunName), [ClauseToGen2]),
  +					[Form1, NewForm];
  +				    _ -> [add_actual_parameter(Form, {FunName, Arity, Exp1, Info})]
  +				end;
  +		    _ -> [Form] 
  +		end
  +	end,		
  +    AnnAST1 =refac_syntax:form_list([T|| Form<-Forms, T <- F(Form)]),
  +    refac_util:write_refactored_files_for_preview([{{FileName,FileName}, AnnAST1}]),
  +    {ok, [FileName]}.
  +
  +replace_clause_body(C, FunName, Arity,Exp, Exp1, Info) ->
  +    {EStart, EEnd} = refac_util:get_range(Exp),
  +    {CStart, CEnd} = refac_util:get_range(C),
  +    case (CStart =< EStart) andalso (EEnd =< CEnd) of
  +	true ->
  +	    Pats = refac_syntax:clause_patterns(C),
  +	    G = refac_syntax:clause_guard(C),
  +	    Body = [refac_syntax:application(refac_syntax:atom(FunName), Pats++[Exp1])],
  +	    refac_syntax:copy_attrs(C, refac_syntax:clause(Pats, G, Body));
  +	_ -> add_actual_parameter(C, {FunName, Arity, Exp1, Info})
  +    end.
  +	
  +    
   replace_exp_with_var(Tree, {ParName, Exp, SideEffect}) ->
       {Tree1, _} =refac_util:stop_tdTP(fun do_replace_exp_with_var/2, Tree, {ParName, Exp, SideEffect}),
       Tree1.
  
positive.code: 	   {refac_syntax:atom(undefined), true};
  	_ -> {Tree,false}
      end.
  %% =====================================================================
  %%
  do_gen_fun(Tree, {ModName, ParName, FunName, Arity, DefPos,Info, Exp, SideEffect}) ->    
  
negative.code: 
  -export([generalise/6, generalise_eclipse/6]).
  
  -export([gen_fun_1/8, gen_fun_clause/8,gen_fun_1_eclipse/8, gen_fun_2_eclipse/8]).
  
  -define(DEFAULT_RANGE, {?DEFAULT_LOC, ?DEFAULT_LOC}).
  %% =====================================================================
  