anchor.diff:  %% OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
   %% ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   %% =====================================================================
  -%% The refactoring command level API that can be run in an Erlang shell.
  +%% The extended refactoring command interface.
   %%
  -%% Author contact: H.Li@kent.ac.uk, Simon.J.Thompson@kent.ac.uk
  +%% Author contact: H.Li@kent.ac.uk
   %%
   %% =====================================================================
  -%%@hidden
  -%%@private
  +%% @doc This module specifies the generalised interfaces of some elementary refactorings.
   -module(wrangler_extended).
   
  --export([rename_fun/4, 
  -         rename_var/5, 
  -         swap_args/5,
  -         tuple_args/5,
  -         fold_expr/5,
  -         gen_fun/5,
  +-export([rename_fun/5, 
  +         rename_var/6, 
  +         rename_mod/4,
  +         swap_args/6,
  +         tuple_args/6,
  +         fold_expr/6,
            gen_fun/6,
  -         move_fun/4,
  -         unfold_fun_app/3]).
  -
  --export([gen_question/2]).
  +         gen_fun/7,
  +         move_fun/5,
  +         unfold_fun_app/5]).
  +
  +-compile(export_all).
   
   -include("../include/wrangler.hrl").
  - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  -%%                                                              %%
  -%% Generalised interface for moving a function btw modules.     %%
  -%%                                                              %%
  -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  +
  +-type (elementary_refac()::{refactoring, {atom(), atom()}, [term()]}).
   
   -type (file_filter()::{file,fun((File::filename()) -> boolean())}).
   
  
positive.code:         _ ->   
              ?FULL_TD_TU(
                 [?COLLECT(?T("V@"), 
                           {range, {File, [api_refac:start_end_loc(V@)]},?SPLICE(V@)},
                           api_refac:type(V@)==variable andalso
                           api_refac:bound_vars(V@)/=[] andalso 
                           case VarFilter of 
  
negative.code:                          end)], FunDef)
      end.
   
  get_app_locs(File, {FunName, Arity}, AppFilter) ->
      ModName=list_to_atom(filename:basename(File, ".erl")),
      FunDef=api_refac:mfa_to_fun_def({ModName, FunName, Arity}, File),
      case FunDef of 
          none -> 
              [];
          _ ->   
              ?FULL_TD_TU(
                 [?COLLECT(?T("F@(Args@@)"), 
                           element(1, api_refac:start_end_loc(_This@)),
                           api_refac:type(_This@)==application  andalso
                           case AppFilter of 
                                {M, F, A} -> {M, F, A}==api_refac:fun_define_info(F@);
                                _ -> AppFilter(api_refac:fun_define_info(F@))
                            end
                          )], FunDef)
      end.
  %%@private
  gen_question(rename_fun_by_name,[File,{F,A}, _NewName, _SearchPaths]) ->
      M=list_to_atom(filename:basename(File, ".erl")),
      lists:flatten(io_lib:format("Do you want to rename function ~p:~p/~p?", [M,F,A]));
  gen_question(rename_mod,[File, _NewName, _SearchPaths]) ->
      M=list_to_atom(filename:basename(File, ".erl")),
      lists:flatten(io_lib:format("Do you want to rename module '~p'?", [M]));
  gen_question(rename_var,[File,{F,A},{range, {_File, _Loc}, V}, _, _]) ->
      M=list_to_atom(filename:basename(File, ".erl")),
      lists:flatten(io_lib:format("Do you want to rename variable ~s in function ~p:~p/~p?", [V,M,F,A]));
  