diff options
author | Felix Lange <fjl@twurst.com> | 2011-10-14 05:45:42 +0200 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2011-10-14 05:45:42 +0200 |
commit | bd5145368593e09460d4461256ee4f934b2ebf26 (patch) | |
tree | 471852782d61d64bede27d67552eb79af0a598aa /src/edit_eval.erl | |
parent | 90640c1aed302fd83a500bb9ccdfb6cf7b481112 (diff) | |
download | ermacs-fork-bd5145368593e09460d4461256ee4f934b2ebf26.tar.gz |
remove cruft
cruft includes:
- module header comments (yikes..)
- author attributes (sorry luke)
- old guard tests
Diffstat (limited to 'src/edit_eval.erl')
-rw-r--r-- | src/edit_eval.erl | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/edit_eval.erl b/src/edit_eval.erl index 24a102e..a8e749c 100644 --- a/src/edit_eval.erl +++ b/src/edit_eval.erl @@ -1,14 +1,5 @@ -%%%---------------------------------------------------------------------- -%%% File : edit_eval.erl -%%% Author : Luke Gorrie <luke@bluetail.com> -%%% Purpose : Erlang code evaluation -%%% Created : 21 Jan 2001 by Luke Gorrie <luke@bluetail.com> -%%%---------------------------------------------------------------------- - -module(edit_eval). --author('luke@bluetail.com'). - --include_lib("ermacs/include/edit.hrl"). +-include("edit.hrl"). -compile({parse_transform, edit_transform}). @@ -178,13 +169,16 @@ find_start(Buf) -> not_found -> 1; X -> - edit_lib:min(X + length(?PROMPT), edit_buf:point_max(Buf)) + min(X + length(?PROMPT), edit_buf:point_max(Buf)) end. %% local_func(Function, Args, Bindings, Shell) -> %% {value,Val,Bs} %% Evaluate local functions, including shell commands. +local_func(F, As0, Bs0, Buf) when is_function(F) -> + {As,Bs} = erl_eval:expr_list(As0, Bs0, {eval,{?MODULE,local_func},[Buf]}), + {value, apply(F, As),Bs}; local_func(F, As0, Bs0, Buf) -> {As,Bs} = erl_eval:expr_list(As0, Bs0, {eval,{?MODULE,local_func},[Buf]}), case erlang:function_exported(user_default, F, length(As)) of @@ -192,11 +186,7 @@ local_func(F, As0, Bs0, Buf) -> {value,apply(user_default, F, As),Bs}; false -> {value,apply(shell_default, F, As),Bs} - end; -local_func(F, As0, Bs0, Buf) -> - {As,Bs} = erl_eval:expr_list(As0, Bs0, {eval,{?MODULE,local_func},[Buf]}), - {value,apply(F, As),Bs}. - + end. %% ---------------------------------------------------------------------- %% Evaluation server API |