anchor.diff:      %% TOCHANGE: there is not def for literal patterns.
       PsDefPoss = lists:map(fun (P) ->
   				  Ann = refac_syntax:get_ann(P),
  -				  {value, {def, DefinePos}} = lists:keysearch(def, 1, Ann),
  -				  DefinePos
  +				  case lists:keysearch(def, 1, Ann) of 
  +				      {value, {def, DefinePos}}  -> DefinePos;
  +				      _ -> false
  +				  end
   			  end, Ps),
  -    Subst = lists:zip(PsDefPoss, Args),
  +    Subst = [{P, A}||{P, A}<-lists:zip(PsDefPoss, Args), P=/=false],
       {SubstedBody, _} = lists:unzip([refac_util:stop_tdTP(fun do_subst/2, E, Subst) || E <- B]),
       Fs = refac_syntax:form_list_elements(AnnAST),
  -    Fs1 = [do_inline(F, Pos, App, SubstedBody) || F <- Fs],
  +    Fs1 = [do_inline(F, Pos, Clause, App, SubstedBody) || F <- Fs],
       AnnAST1 = refac_util:rewrite(AnnAST, refac_syntax:form_list(Fs1)),
       case Editor of
         emacs ->
  -	  refac_util:write_refactored_files_for_preview([{{FName, FName}, AnnAST1}]),
  -	  {ok, [FName]};
  -      eclipse ->
  -	  Content = refac_prettypr:print_ast(refac_util:file_format(FName), AnnAST1),
  -	  {ok, [{FName, FName, Content}]}
  -    end.
  -
  -
  -do_inline(Form, Pos, App, SubstedBody) ->
  +	    refac_util:write_refactored_files_for_preview([{{FName, FName}, AnnAST1}], ""),
  +	    {ok, [FName]};
  +	eclipse ->
  +	    Content = refac_prettypr:print_ast(refac_util:file_format(FName), AnnAST1),
  +	    {ok, [{FName, FName, Content}]}
  +    end.
  +
  +
  +do_inline(Form, Pos, Clause,App, SubstedBody) ->
       {S, E} = refac_util:get_range(Form),
       if  (S =< Pos) and (Pos =< E) ->
   	    {F1, _} = refac_util:stop_tdTP(
   			fun do_inline_1/2, Form, {App, SubstedBody}),
  -	    F1;
  +	    case length(SubstedBody) >1 of 
  +		true ->
  +		    Exprs = collect_exprs_in_expr_sequences(Clause),
  +		    case lists:member(App, Exprs) of
  +			true ->
  +			    {F2, _} = refac_util:stop_tdTP(fun remove_begin_end/2, F1, SubstedBody),
  +			    F2;
  +			_ -> F1
  +		    end;
  +		_ -> F1
  +	    end;
   	true ->
   	    Form
       end.
  +
   do_inline_1(Node, {App, SubstedBody}) ->
       case Node of
   	App ->
  
positive.code: 	_ ->{Node,false}
      end.
  	
  	    
      
  pos_to_fun_app(Node, Pos) ->
      case refac_util:once_tdTU(fun pos_to_fun_app_1/2, Node, Pos) of
  	{_, false} -> {error, "You have not selected a function application, "
  		       "or the function containing the function application does not parse."};
  	{R, true} -> {ok, R}
      end.
  
  pos_to_fun_app_1(Node, Pos) ->
  
negative.code: inline_fun(FName, Pos = {Line, Col}, SearchPaths, TabWidth, Editor) ->
      ?wrangler_io("\nCMD: ~p:inline_fun(~p, {~p,~p}, ~p, ~p).\n",
  		 [?MODULE, FName, Line, Col, SearchPaths, TabWidth]),
      {ok, {AnnAST, Info}} = refac_util:parse_annotate_file(FName, true, SearchPaths, TabWidth),
      {value, {module, ModName}} = lists:keysearch(module, 1, Info),
      case pos_to_fun_clause_app(AnnAST, Pos) of
  	{ok, {Clause, App}} -> 
  	    {ok, FunDef} = side_cond_analysis(ModName, AnnAST, {Clause, App}),
  	    fun_inline_1(FName, AnnAST, Pos, FunDef, {Clause, App}, Editor);
  	{error, Reason} -> throw({error, Reason})
      end.
      
  
  side_cond_analysis(ModName, AnnAST, {Clause, App}) ->
      FunName = refac_syntax:atom_value(refac_syntax:application_operator(App)),
      Args = refac_syntax:application_arguments(App),
      Arity = length(Args),
  