anchor.diff:  
   get_fun_def_mod(Node) ->
       As = refac_syntax:get_ann(Node),
  -    case lists:keysearch(fun_def, 1, As) of 
  -	{value, {fun_def, {M, _N, _A, _P, _DefinePos}}} -> M;
  +    case lists:keysearch(fun_def, 1, As) of
  +      {value, {fun_def, {M, _N, _A, _P, _DefinePos}}} -> M;
         _ -> '_'
       end.
   
   rename_fun_in_client_modules(Files, {Mod, Fun, Arity}, NewName, SearchPaths, TabWidth, Pid) ->
       case Files of
         [] -> [];
  -      [F | Fs] ->
  -	    ?wrangler_io("The current file under refactoring is:\n~p\n", [F]),
  -	    {ok, {AnnAST, Info}}= refac_util:parse_annotate_file(F, true, SearchPaths, TabWidth),
  -	    {AnnAST1, Changed} = rename_fun_in_client_module_1(F, {AnnAST, Info},{Mod, Fun, Arity}, NewName, SearchPaths, Pid, TabWidth),
  -	    check_atoms(F, AnnAST1, [Fun], Pid),
  -	    if Changed ->
  -		    [{{F, F}, AnnAST1} | rename_fun_in_client_modules(Fs, {Mod, Fun, Arity}, NewName, SearchPaths, TabWidth, Pid)];
  -	       true ->
  -		    rename_fun_in_client_modules(Fs, {Mod, Fun, Arity}, NewName, SearchPaths, TabWidth, Pid)
  -	    end
  +      [F| Fs] ->
  +	  ?wrangler_io("The current file under refactoring is:\n~p\n", [F]),
  +	  {ok, {AnnAST0, Info}} = refac_util:parse_annotate_file(F, true, SearchPaths, TabWidth),
  +	  AnnAST = refac_type_annotation:type_ann_ast(F, AnnAST0, SearchPaths, TabWidth),
  +	  {AnnAST1, Changed} = rename_fun_in_client_module_1({AnnAST, Info}, {Mod, Fun, Arity}, NewName),
  +	  check_atoms(F, AnnAST1, [Fun], Pid),
  +	  if Changed ->
  +		 [{{F, F}, AnnAST1}| rename_fun_in_client_modules(
  +				       Fs, {Mod, Fun, Arity}, NewName, SearchPaths, TabWidth, Pid)];
  +	     true ->
  +		 rename_fun_in_client_modules(
  +		   Fs, {Mod, Fun, Arity}, NewName, SearchPaths, TabWidth, Pid)
  +	  end
       end.
   
   get_fun_def_info(Node) ->
       As = refac_syntax:get_ann(Node),
       case lists:keysearch(fun_def, 1, As) of
         {value, {fun_def, {Mod, FunName, Arity, _UsePos, DefinePos}}} ->
  -	    {Mod, FunName, Arity, DefinePos};
  -	_ -> false
  -    end.
  -
  -rename_fun_in_client_module_1(FileName, {Tree, Info}, {M, OldName, Arity}, NewName, SearchPaths, Pid, TabWidth) ->
  +	  {Mod, FunName, Arity, DefinePos};
  +      _ -> false
  +    end.
  +
  +rename_fun_in_client_module_1({Tree, Info}, {M, OldName, Arity}, NewName) ->
       case lists:keysearch(module, 1, Info) of
         {value, {module, ClientModName}} ->
  -	    Inscope_Funs = [{F, A} ||{_M, F, A}<-refac_util:inscope_funs(Info)],
  -	    case lists:member({list_to_atom(NewName), Arity}, Inscope_Funs)
  -		and lists:member({OldName, Arity}, Inscope_Funs) of
  -		true ->
  -		    throw({error, "The new function name causes confliction in module '" 
  -			   ++ atom_to_list(ClientModName)++"'"});
  -		_ -> ok
  -	    end;
  -	_ -> ok
  +	  Inscope_Funs = [{F, A} || {_M, F, A} <- refac_util:inscope_funs(Info)],
  +	  case
  +	    lists:member({list_to_atom(NewName), Arity}, Inscope_Funs)
  +	      and lists:member({OldName, Arity}, Inscope_Funs)
  +	      of
  +	    true ->
  +		throw({error, "The new function name causes confliction in module '"
  +				++ atom_to_list(ClientModName) ++ "'"});
  +	    _ -> ok
  +	  end;
  +      _ -> ok
       end,
  -    refac_util:full_tdTP(fun do_rename_fun_in_client_module_1/2, Tree, 
  -			 {FileName,{M, OldName, Arity}, NewName, SearchPaths, Pid,TabWidth}).
  -  
  -
  -do_rename_fun_in_client_module_1(Tree, {FileName, {M, OldName, Arity}, NewName, SearchPaths, Pid, TabWidth}) ->
  +    refac_util:full_tdTP(fun do_rename_fun_in_client_module_1/2, Tree,
  +			 {{M, OldName, Arity}, NewName}).
  +
  +do_rename_fun_in_client_module_1(Tree, {{M, OldName, Arity}, NewName}) ->
       case refac_syntax:type(Tree) of
  -      application -> do_rename_in_fun_app(Tree, FileName, M, OldName, Arity, NewName, SearchPaths, TabWidth);
  +      application -> do_rename_in_fun_app(Tree, M, OldName, Arity, NewName);
         arity_qualifier ->   %% is there a module name?
   	  do_rename_fun_in_arity_qualifier(Tree, M, OldName, Arity, NewName);
  -      tuple ->
  -	  do_rename_fun_in_tuples(Tree, {FileName, SearchPaths, M, OldName, NewName, Arity, Pid, TabWidth});
  +      atom ->
  +	  As = refac_syntax:get_ann(Tree),
  +	  case lists:keysearch(type, 1, As) of
  +	    {value, {type, {f_atom, [M, OldName, Arity]}}} ->
  +		{refac_syntax:copy_attrs(Tree, refac_syntax:atom(NewName)), true};
  +	    _ -> {Tree, false}
  +	  end;
         _ -> {Tree, false}
       end.
  -
   
   do_rename_fun_in_arity_qualifier(Tree, M, OldName, Arity, NewName) ->
       Fun = refac_syntax:arity_qualifier_body(Tree),
  
positive.code:     ?wrangler_io("\nCMD: ~p:rename_fun( ~p, ~p, ~p, ~p,~p, ~p).\n",
  		 [?MODULE, FileName, Line, Col, NewName, SearchPaths, TabWidth]),
      Cmd1 = "CMD: " ++ atom_to_list(?MODULE) ++ ":rename_fun(" ++ "\"" ++
  	FileName ++ "\", " ++ integer_to_list(Line) ++
  	", " ++ integer_to_list(Col) ++ ", " ++ "\"" ++ NewName ++ "\","
  	++ "[" ++ refac_util:format_search_paths(SearchPaths) ++ "]," ++ integer_to_list(TabWidth) ++ ").",
      case refac_util:is_fun_name(NewName) of
        true -> ok;
        false -> throw({error, "Invalid new function name!"})
      end,
      {ok, {AnnAST, Info}} = refac_util:parse_annotate_file(FileName, true, SearchPaths, TabWidth),
      NewName1 = list_to_atom(NewName),
      {ok, ModName} = get_module_name(Info),
      case refac_util:pos_to_fun_name(AnnAST, {Line, Col}) of
        {ok, {Mod, Fun, Arity, _, DefinePos}} ->
  	  case {ModName, NewName1} =/= {Mod, Fun} of
  	    true ->
  		  case pre_cond_check(FileName, Info, NewName1, Mod, Fun, Arity) of
  		      ok ->
  			  rename_fun_0(FileName, NewName, SearchPaths, TabWidth, 
  				       Editor, AnnAST, Info, NewName1,
  				       Mod, Fun, Arity, DefinePos, Cmd1);
  		      Others -> Others
  		  end;
  	      _ ->
  		  case Editor of
  		      emacs -> {ok, []};
  		      eclipse ->
  
negative.code: 			'!' ->
  			    case refac_syntax:type(Left) of
  			      atom ->
  				  AtomVal = refac_syntax:atom_value(Left),
  				  case lists:member(AtomVal, AtomNames) of
  				    true ->
  					S ++ [{process, refac_syntax:get_pos(Left), AtomVal}];
  				    _ -> S
  				  end;
  			      _ -> S
  			    end;
  			_ -> S
  		      end;
  		  record_expr -> Type = refac_syntax:record_expr_type(T),
  				 collect_atoms_1(AtomNames, S, Type, record);
  		  record_field -> Name = refac_syntax:record_field_name(T),
  				  case refac_syntax:type(Name) of
  				    atom ->
  					AtomVal = refac_syntax:atom_value(Name),
  					case lists:member(AtomVal, AtomNames) of
  					  true ->
  					      S ++ [{record, refac_syntax:get_pos(Name), AtomVal}];
  					  _ -> S
  					end;
  				    _ -> S
  				  end;
  		  record_access -> Type = refac_syntax:record_access_type(T),
  				   Field = refac_syntax:record_access_field(T),
  				   S1 = collect_atoms_1(AtomNames, S, Type, record),
  				   case refac_syntax:type(Field) of
  				     atom ->
  					 AtomVal = refac_syntax:atom_value(Field),
  					 case lists:member(AtomVal, AtomNames) of
  					   true ->
  					       S ++ [{record, refac_syntax:get_pos(Field), AtomVal}];
  					   false ->
  					       S
  					 end;
  				     _ -> S1
  				   end;
  		  atom ->
  		      AtomVal = refac_syntax:atom_value(T),
  		      case lists:member(AtomVal, AtomNames) of
  			true ->
  			    As = refac_syntax:get_ann(T),
  			      case lists:keysearch(type, 1, As) of
  				  {value, {type, {f_atom, [MName, FName, Arity]}}} 
  				    when is_atom(MName) andalso MName/='_' andalso
  					 is_atom(FName) andalso MName/='_' andalso
  					 is_integer(Arity) -> S;
  				  _ -> 
  				      Pos = refac_syntax:get_pos(T), S ++ [{atom, Pos, AtomVal}]
  				  end;
  			  false -> S
  		      end;
  		    _ -> S
  		end
  	end,
      refac_syntax_lib:fold(F, [], Tree).
  
  collect_atoms_1(AtomNames, S, Node, Type) ->
      F = fun (T, Acc) ->
  		case refac_syntax:type(T) of
  		  atom ->
  		      AtomVal = refac_syntax:atom_value(T),
  		      case lists:member(AtomVal, AtomNames) of
  			true when Type == function ->
  			    Ann = refac_syntax:get_ann(T),
  			    case lists:keysearch(fun_def, 1, Ann) of
  			      {value, {fun_def, {'_', _, _, _, _}}} ->
  				  Acc ++ [{atom, refac_syntax:get_pos(T), AtomVal}];
  			      {value, {fun_def, {_, '_', _, _, _}}} ->
  				  Acc ++ [{atom, refac_syntax:get_pos(T), AtomVal}];
  			      {value, {fun_def, {_, _, '_', _, _}}} ->
  				  Acc ++ [{atom, refac_syntax:get_pos(T), AtomVal}];
  			      {value, _} ->
  				  Acc ++ [{function, refac_syntax:get_pos(T), AtomVal}];
  			      false ->
  				  Acc ++ [{atom, refac_syntax:get_pos(T), AtomVal}]
  			    end;
  			true ->
  			    Acc ++ [{Type, refac_syntax:get_pos(T), AtomVal}];
  			false ->
  			    Acc
  		      end;
  		  _ -> Acc
  		end
  	end,
      refac_syntax_lib:fold(F, S, Node).
  
  try_eval(none, Node, _, _) ->
      try
  	erl_eval:exprs([refac_syntax:revert(Node)], [])
      of
  	{value, Val, _} -> {value, Val}
      catch
  	_E1:_E2 ->
  	    {error, no_value}
      end;	    
  try_eval(FileName, Node, SearchPaths, TabWidth) ->
      try
        erl_eval:exprs([refac_syntax:revert(Node)], [])
  