anchor.diff:  					macro_name ->
   					    {error, "Sorry, renaming of macro names is not supported yet."};
   					_ ->
  -					    case cond_check(AnnAST1, DefinePos, NewName1) of
  -						{true, _} ->
  -						    {error, "New name already declared in the same scope."};
  -						{_, true} -> {error, "New name could cause name shadowing."};
  +					    Form = pos_to_form(AnnAST1, {Line, Col}), 
  +					    Res = cond_check(Form, DefinePos, VarName, NewName1),
  +					    case Res of
  +						{true, _, _} ->
  +						    {error, "The new name is already declared in the same scope."};
  +						{_, true,_} -> {error, "The new name could cause name shadowing."};
  +						{_, _, true} -> {error, "The new name could change the existing binding structure of variables."};
   						_ ->
   						    {AnnAST2, _Changed} = rename(AnnAST1, DefinePos, NewName1),
   						    case Editor of 
  
positive.code: 
  %% =====================================================================
  %%
  do_rename(Tree, {DefinePos, NewName}) ->
      case refac_syntax:type(Tree) of
        variable ->
  
negative.code: %% =====================================================================
  %% @spec cond_check(Tree::syntaxTree(), Pos::{integer(),integer()}, NewName::string())-> term()
  %%   		
  cond_check(Form, Pos, VarName,  NewName) ->
      Env_Bd_Fr_Vars = envs_bounds_frees(Form),
      F_Pos = fun ({_, DefPos}) -> DefPos end,
      F_Name = fun ({Name, _}) -> Name end,
      BdVars = lists:map(fun ({_, B, _}) -> B end, Env_Bd_Fr_Vars),
      %% io:format("vars:\n~p\n", [Env_Bd_Fr_Vars]),
      %% The new name clashes with existing bound variables.
      F = fun({bound, Bds}) ->
  		Poss = lists:map(F_Pos, Bds),
  		Names = lists:map(F_Name, Bds),
  		case lists:any(fun(P) -> lists:member(P, Poss) end, Pos)
  		    andalso lists:member(NewName, Names) of 
  		    false -> false;
  		    true -> DefPoss = element(2, lists:unzip(
  						   lists:filter(fun({Name, _}) ->
  									NewName==Name 
  								end, Bds))),
  			    VarEnvs = lists:map(fun(P) ->defpos_to_var_env(Form, [P]) end, DefPoss),
  			    VarToRenameEnv = defpos_to_var_env(Form, Pos),
  	   
  			    case lists:any(fun({N,_P}) ->N==NewName end, VarToRenameEnv) of 
   				true ->
   				    true;
   				false ->
  				    lists:any(fun(E) ->lists:any(fun({N,_P})-> N==VarName end, E) end, VarEnvs)
   			    end
  		end	      
  	end,
      Clash = lists:any(F, BdVars),
      %% The new name will shadow an existing free variable within the scope.
      Shadow1 = lists:any(fun ({{env, _}, {bound, Bds}, {free, Fs}}) ->
  				Poss = lists:map(F_Pos, Bds),
  