anchor.diff:  %% change the semantics of the function to be generalised. </li>
   %% </p>
   %% <p> Usage: to apply this refactoring, highlight the expression first, then  select 
  -%% <em> Generalise Function Definition </em> from the <em>Refactor</em> menu, after 
  +%% <em> Generalise Function Definitio5n </em> from the <em>Refactor</em> menu, after 
   %% that the refactorer will prompt to enter the parameter name in the mini-buffer. </p>
   %% 
   %% NOTE: in Erlang some literal expressions can not be replaced by variables. For example, the atom <code>fields</code>
   %% in the expression <code>record_info(fields, Record)</code> should not be replaced by a variable or other expressions.
   %% This kind of checking is NOT supported by Wrangler yet.
  -%%-spec(generalise/6::(FileName::filename(),Start::pos(), End::pos(),ParName::string(),
  -%%		     SearchPaths::[dir()], TabWidth::integer()) ->
  -%%	     {ok, [filename()]}
  -%%		 |{error, string()}
  -%%                |{multiple_instances, {atom(), atom(), integer(), pos(), syntaxTree(), boolean(),[{pos(), pos()}], string()}}
  -%%		 |{unknown_side_effect, {atom(), atom(),integer(), pos(), syntaxTree(), integer(),
  -%%					 [{pos(), pos()}], [{pos(),pos()}], string()}}
  -%%		 |{more_than_one_clause, {atom(), atom(), integer(), pos(), syntaxTree(), boolean(),
  -%%					  [{pos(), pos()}], [{pos(),pos()}], string()}}). 
  -generalise(FileName, Start, End, ParName, SearchPaths, TabWidth, Editor) ->
  -    try_refactoring(refac_gen, generalise, [FileName, Start, End, ParName,  SearchPaths, TabWidth, Editor]).
  -
  -
  -%%@private
  -%%-spec(gen_fun_1/12::(SideEffect::boolean(), FileName::filename(),ParName::atom(), FunName::atom(),
  -%%		     Arity::integer(), FunDefPos::pos(), Exp::syntaxTree(), DupsInFun::[{pos(), pos()}],SearchPaths::[dir()],
  -%%		     TabWidth::integer(), Editor::atom(),LogCmd::string())
  -%%     -> {ok, [filename()]} | {error, string()}).
  -gen_fun_1(SideEffect, FileName,ParName, FunName, Arity, DefPos, Exp, DupsInFun,SearchPaths,TabWidth, Editor, LogCmd) ->
  -    try_refactoring(refac_gen, gen_fun_1, [SideEffect, FileName,ParName, FunName, Arity, DefPos, Exp, 
  -                                           SearchPaths,TabWidth,DupsInFun, Editor, LogCmd]).
  -
  -%%@private
  -%%-spec(gen_fun_clause/11::(FileName::filename(), ParName::atom(), FunName::atom(), Arity::integer(), DefPos::pos(), 
  -%%			  Exp::syntaxTree(), TabWidth::integer(), SideEffect::boolean(), 
  -%%			  Dups::[{{integer(), integer()},{integer(), integer()}}], Editor::atom(), LogCmd::string()) 
  -%%     ->{ok, [filename()]} | {error, string()}).
  -
  -gen_fun_clause(FileName, ParName, FunName, Arity, DefPos, Exp, TabWidth, SideEffect, Dups, Editor, LogCmd) ->
  -    try_refactoring(refac_gen, gen_fun_clause, [FileName, ParName, FunName, Arity, DefPos, Exp, TabWidth, SideEffect, Dups, Editor, LogCmd]).
  +-spec(generalise/7::(FileName::filename(),Start::[integer()], End::[integer()],ParName::string(),
  +		     SearchPaths::[dir()], context(), TabWidth::integer()) ->
  +	     {ok, [filename()]}
  +		 |{error, string()}
  +                |{multiple_instances, {atom(), atom(), integer(), pos(), syntaxTree(), boolean(),[{pos(), pos()}], string()}}
  +		 |{unknown_side_effect, {atom(), atom(),integer(), pos(), syntaxTree(), integer(),
  +					 [{pos(), pos()}], [{pos(),pos()}], string()}}
  +		 |{more_than_one_clause, {atom(), atom(), integer(), pos(), syntaxTree(), boolean(),
  +					  [{pos(), pos()}], [{pos(),pos()}], string()}}). 
  +generalise(FileName, _Start=[SLn, SCol], _End=[ELn, ECol], ParName, SearchPaths,  Context, TabWidth) ->
  +    try_refac(refac_gen, generalise, [FileName, {SLn, SCol}, {ELn, ECol}, ParName, SearchPaths, Context, TabWidth]).
  +
  +
  +%%@private
  +-spec(gen_fun_1/12::(SideEffect::boolean(), FileName::filename(),ParName::atom(), FunName::atom(),
  +		     Arity::integer(), FunDefPos::pos(), Exp::syntaxTree(), DupsInFun::[{pos(), pos()}],SearchPaths::[dir()],
  +		     TabWidth::integer(), Context::atom(),LogCmd::string())
  +     -> {ok, [filename()]} | {error, string()}).
  +gen_fun_1(SideEffect, FileName,ParName, FunName, Arity, DefPos, Exp, DupsInFun,SearchPaths, Context, TabWidth, LogCmd) ->
  +    try_refac(refac_gen, gen_fun_1, [SideEffect, FileName, ParName, FunName, Arity, DefPos, Exp,
  +                                     SearchPaths, TabWidth, DupsInFun, Context, LogCmd]).
  +
  +%%@private
  +-spec(gen_fun_clause/11::(FileName::filename(), ParName::atom(), FunName::atom(), Arity::integer(), DefPos::pos(), 
  +			  Exp::syntaxTree(), TabWidth::integer(), SideEffect::boolean(), 
  +			  Dups::[{{integer(), integer()},{integer(), integer()}}], Context::atom(), LogCmd::string()) 
  +     ->{ok, [filename()]} | {error, string()}).
  +
  +gen_fun_clause(FileName, ParName, FunName, Arity, DefPos, Exp, TabWidth, SideEffect, Dups, Context, LogCmd) ->
  +    try_refac(refac_gen, gen_fun_clause, [FileName, ParName, FunName, Arity, DefPos, Exp, TabWidth, SideEffect, Dups, Context, LogCmd]).
    
   
   %%@private
  -%%-spec(generalise_eclipse/6::(FileName::filename(),Start::pos(), End::pos(),ParName::string(), 
  -%%			     SearchPaths::[dir()], TabWidth::integer()) -> 
  -%%	     {error, string()} |{ok, [{filename(), filename(), string()}]}
  -%%		 |{multiple_instances,  {ParName:: atom(), FunName::atom(), Arity::integer(),
  -%%					 FunDefPos::pos(), Exp::syntaxTree(), SideEffect::boolean(),
  -%%				 	 DupsInFun::[{pos(), pos()}], LogCmd::string()}}
  -%%		 |{unknown_side_effect, {ParName::atom(), FunName::atom(),Arity::integer(), 
  -%%				  	 FunDefPos::pos(), Exp::syntaxTree(), NoOfClauses::integer(),
  -%%					 DupsInFun::[{pos(), pos()}],DupsInClause::[{pos(), pos()}], LogCmd::string()}}
  -%%		 |{more_than_one_clause,{ParName::atom(), FunName::atom(), Arity::integer(), 
  -%%					 FunDefPos::pos(), Exp::syntaxTree(), SideEffect::boolean(),
  -%%					 DupsInFun::[{pos(), pos()}],DupsInClause::[{pos(), pos()}], Logcmd::string()}}).
  +-spec(generalise_eclipse/6::(FileName::filename(),Start::pos(), End::pos(),ParName::string(), 
  +			     SearchPaths::[dir()], TabWidth::integer()) -> 
  +	     {error, string()} |{ok, [{filename(), filename(), string()}]}
  +		 |{multiple_instances,  {ParName:: atom(), FunName::atom(), Arity::integer(),
  +					 FunDefPos::pos(), Exp::syntaxTree(), SideEffect::boolean(),
  +				 	 DupsInFun::[{pos(), pos()}], LogCmd::string()}}
  +		 |{unknown_side_effect, {ParName::atom(), FunName::atom(),Arity::integer(), 
  +				  	 FunDefPos::pos(), Exp::syntaxTree(), NoOfClauses::integer(),
  +					 DupsInFun::[{pos(), pos()}],DupsInClause::[{pos(), pos()}], LogCmd::string()}}
  +		 |{more_than_one_clause,{ParName::atom(), FunName::atom(), Arity::integer(), 
  +					 FunDefPos::pos(), Exp::syntaxTree(), SideEffect::boolean(),
  +					 DupsInFun::[{pos(), pos()}],DupsInClause::[{pos(), pos()}], Logcmd::string()}}).
   generalise_eclipse(FileName, Start, End, ParName, SearchPaths, TabWidth) ->
  -    try_refactoring(refac_gen, generalise_eclipse, [FileName, Start, End, ParName,  SearchPaths, TabWidth]).
  -
  -%%@private
  -%%-spec(gen_fun_1_eclipse/11::(SideEffect::boolean(), FileName::filename(),ParName::atom(), FunName::atom(), 
  -%%			     Arity::integer(), FunDefPos::pos(), Expr::syntaxTree(),  Dups::[{pos(), pos()}], SearchPaths::[dir()],
  -%%			     TabWidth::integer(), LogCmd::string()) 
  -%%     -> {ok, [{filename(), filename(),string()}]} | {error, string()}).
  +    try_refac(refac_gen, generalise_eclipse, [FileName, Start, End, ParName, SearchPaths, TabWidth]).
  +
  +%%@private
  +-spec(gen_fun_1_eclipse/11::(SideEffect::boolean(), FileName::filename(),ParName::atom(), FunName::atom(), 
  +			     Arity::integer(), FunDefPos::pos(), Expr::syntaxTree(),  Dups::[{pos(), pos()}], SearchPaths::[dir()],
  +			     TabWidth::integer(), LogCmd::string()) 
  +     -> {ok, [{filename(), filename(),string()}]} | {error, string()}).
   gen_fun_1_eclipse(SideEffect, FileName, ParName, FunName, Arity, FunDefPos, Expr,Dups, SearchPaths, TabWidth, LogCmd) ->
  -    try_refactoring(refac_gen, gen_fun_1_eclipse, [SideEffect, FileName, ParName, FunName, Arity, FunDefPos, Expr, SearchPaths, TabWidth, Dups, LogCmd]).
  -
  -
  -%%@private
  -%%-spec(gen_fun_clause_eclipse/10::(FileName::filename(), ParName::atom(), FunName::atom(), Arity::integer(), DefPos::pos(), 
  -%%			 Exp::syntaxTree(), TabWidth::integer(), SideEffect::boolean(),  Dups::[{pos(), pos()}], LogCmd::string()) ->
  -%%	     {ok, [{filename(), filename(), string()}]} | {error, string()}).
  +    try_refac(refac_gen, gen_fun_1_eclipse, [SideEffect, FileName, ParName, FunName, Arity, FunDefPos, Expr, SearchPaths, TabWidth, Dups, LogCmd]).
  +
  +
  +%%@private
  +-spec(gen_fun_clause_eclipse/10::(FileName::filename(), ParName::atom(), FunName::atom(), Arity::integer(), DefPos::pos(), 
  +			 Exp::syntaxTree(), TabWidth::integer(), SideEffect::boolean(),  Dups::[{pos(), pos()}], LogCmd::string()) ->
  +	     {ok, [{filename(), filename(), string()}]} | {error, string()}).
   gen_fun_clause_eclipse(FileName, ParName, FunName, Arity, DefPos, Exp, TabWidth, SideEffect, Dups, LogCmd) ->
  -    try_refactoring(refac_gen, gen_fun_clause_eclipse, [FileName, ParName, FunName, Arity, DefPos, Exp, TabWidth, SideEffect, Dups, LogCmd]).
  +    try_refac(refac_gen, gen_fun_clause_eclipse, [FileName, ParName, FunName, Arity, DefPos, Exp, TabWidth, SideEffect, Dups, LogCmd]).
   
   
   %% ================================================================================
  
positive.code: %% guide you through the candidates found one by one, and ask you to decide whether to merge.
  %%</p>
  
  %%-spec(merge_forall/3::(FileName::filename, SearchPaths::[dir()], TabWidth::integer()) ->
  %%	     {error, string()} |{not_found, string()} |{ok, [{integer(), integer(), integer(), integer(), string()}], string()}).
  merge_forall(FileName, SearchPaths, TabWidth) ->
      try_refactoring(refac_new_let, merge_forall, [FileName, SearchPaths, TabWidth]).
  
  %%@private
  %%-spec(merge_forall_1/5::(FileName::filename, Candidates::[{{integer(), integer(), integer(), integer()}, string()}],
  %%		      SearchPaths::[dir()], TabWidth::integer(), Cmd::string()) -> {ok, [filename()]}).
  merge_forall_1(FileName, Candidates, SearchPaths, TabWidth, Cmd) ->
      try_refactoring(refac_new_let, merge_forall_1, [FileName, Candidates, SearchPaths, TabWidth, Cmd]).
  
  %%@private
  %%-spec(merge_forall_eclipse/3::(FileName::filename(), SearchPaths::[dir()], TabWidth::integer()) ->
  %%			{error, string()}| {not_found, string()} |{ok, [{{{integer(), integer()}, {integer(), integer()}}, syntaxTree()}]}).
  merge_forall_eclipse(FileName, SearchPaths, TabWidth) ->
      try_refactoring(refac_new_let, merge_forall_eclipse, [FileName, SearchPaths, TabWidth]).
  
  %%@private
  %%-spec(merge_forall_1_eclipse/4::(FileName::filename(), Candidates::[{{{integer(), integer()}, {integer(), integer()}}, syntaxTree()}],
  %%				 SearchPaths::[dir()], TabWidth::integer()) -> 
  %%		{error, string()}|{'ok', [{filename(), filename(),string()}]}).
  merge_forall_1_eclipse(FileName, Candidates, SearchPaths, TabWidth) ->
      try_refactoring(refac_new_let, merge_forall_1_eclipse, [FileName, Candidates, SearchPaths, TabWidth]).
  
  
  %% =============================================================================================
  
negative.code: %% the function definition, then select <em> Tuple Function Arguments </em> from <em> Refactor</em>.
  %% </p>
  
  -spec(tuple_funpar/6::(filename(), [integer()], [integer()], [dir()], context(), integer()) ->
  	     {error, string()} | {ok, [filename()]}).
  tuple_funpar(FileName, _StartLoc=[SLn, SCol], _EndLoc=[ELn, ECol],SearchPaths, Context, TabWidth) ->
      try_refac(refac_tuple, tuple_funpar, [FileName, {SLn, SCol}, {ELn, ECol}, SearchPaths, Context, TabWidth]).
  
  tuple_funpar_1(FileName, _StartLoc=[SLn, SCol], _EndLoc=[ELn, ECol], SearchPaths, Context, TabWidth) ->
      try_refac(refac_tuple, tuple_funpar_1, [FileName, {SLn, SCol}, {ELn, ECol}, SearchPaths, Context, TabWidth]).
  
  
  tuple_args(ModOrFile, FA, Index1,Index2, SearchPaths, Context, TabWidth)->
      try_refac(refac_tuple_par, tuple_args, [ModOrFile, FA, Index1, Index2, SearchPaths, Context, TabWidth]).
  
  
  %%@private
  -spec(tuple_funpar_eclipse/5::(filename(), pos(), pos, [dir()], integer()) ->
       {error, string()} | {ok, [{filename(), filename(), string()}]}).
  tuple_funpar_eclipse(FileName, StartLoc, EndLoc, SearchPaths, TabWidth) ->
      try_refac(refac_tuple, tuple_funpar_eclipse, [FileName, StartLoc, EndLoc, SearchPaths, TabWidth]).
  
  %%@private
  tuple_funpar_eclipse_1(FileName, StartLoc, EndLoc, SearchPaths, TabWidth) ->
      try_refac(refac_tuple, tuple_funpar_eclipse_1, [FileName, StartLoc, EndLoc, SearchPaths, TabWidth]).
  
  
  %%=========================================================================================
  