anchor.diff:  %% @private
   -module(wrangler_add_new_refac).
   
  --export([add/5]).
  +-export([add/6, remove/6]).
  +
  +-compile(export_all).
   
   -include("../include/wrangler_internal.hrl").
   
  -add(File, Type, ExistingMenuItems, IDE, WranglerInstDir) ->
  +add(File, Type, ExistingMenuItems, IDE, WranglerInstDir, Home) ->
       case filename:extension(File) of 
           ".erl" ->
               case is_behaviour_file(File, Type) of 
  
positive.code:                     case lists:member(list_to_atom(ModName),[Name||[_, Name]<-ExistingMenuItems]) of 
                          false ->
                              Dir = get_wrangler_dir(IDE, WranglerInstDir),
                              OutDir = Dir ++ "/ebin",
                              case compile:file(File, [{i, Dir++"/include"}, {outdir, OutDir}]) of
                                  {ok, _} -> 
                                      NewCode = gen_new_code(ModName, Type),
                                      ElFile = Dir ++ "/elisp/wrangler.el",
                                      case file:write_file(ElFile, list_to_binary(NewCode), [append]) of
                                          ok ->
                                              {ok, ElFile};
                                          {error, Reason} ->
                                              {error, Reason}
                                      end;                
                                  _ -> throw({error, "the current file does not compile."})
                              end;
                          _ -> throw({error, "menu item already exists."})
                      end;
                  _ ->
                      Msg = format_msg("the current file does not implement a ~p behaviour.\n",
                                       [Type]),
                      throw({error, Msg})
              end;
          _ ->
              throw({error, "the current file is not an Erlang source file."})
      end. 
  
  
  is_behaviour_file(File, Behaviour) ->
      {ok, {AnnAST, _Info}} = wrangler_ast_server:parse_annotate_file(File, true, []),
  
negative.code: 
  format_msg(Temp, Args) ->
      lists:flatten(io_lib:format(Temp, Args)).
  
  mk_dirs(WranglerExtDir) ->
      WranglerExtEBinDir = filename:join([WranglerExtDir,"ebin"]),
      WranglerExtELispDir = filename:join([WranglerExtDir,"elisp"]),
      case mk_dir(WranglerExtDir) of 
          ok ->
              case mk_dir(WranglerExtEBinDir) of 
                  ok ->
                      case mk_dir(WranglerExtELispDir) of 
                          ok -> ok;
                          {error, Reason} ->
                              {error, Reason}
                      end;
                  {error, Reason} ->
                      {error, Reason}
              end;
          {error,Reason} ->
              {error, Reason}
      end.
  
  mk_dir(Dir) ->
      case filelib:is_dir(Dir) of 
          true ->
              ok;
          false ->
              case file:make_dir(Dir) of 
                  ok ->
                      ok;                    
                  {error, _Reason} ->
                      {error, 
                       format_msg("Wrangler failed to create directory: ~p\n",
                                  [Dir])}
              end
      end.
  