diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/context/third/filter/filter.txt | 17 | ||||
-rw-r--r-- | Master/texmf-dist/tex/context/third/filter/t-filter.mkiv | 21 |
2 files changed, 31 insertions, 7 deletions
diff --git a/Master/texmf-dist/doc/context/third/filter/filter.txt b/Master/texmf-dist/doc/context/third/filter/filter.txt index 13e1acc4898..8a686827b41 100644 --- a/Master/texmf-dist/doc/context/third/filter/filter.txt +++ b/Master/texmf-dist/doc/context/third/filter/filter.txt @@ -284,7 +284,20 @@ external program that you are using. Deleting temporary files ------------------------ -To delete the temporary files generated by the module, call +In MkIV, the module automatically deletes the `\externalfilterinputfile` after +executing the filter unless `\traceexternalfilters` is used. If, for whatever +reason, you want to keep this file around, use + + \defineexternalfilter + [...] + [... + purge=no, + ...] + +In MkII, the `\externalfilterinputfile` is not deleted. + +All the files generated by the filter module have `-temp-` in their name. As +such they can be deleted using context --purgeall --pattern=filename @@ -746,3 +759,5 @@ Version History - Renamed `continue` to `cache`. Using `continue=yes` still works - Removed `force` and `reuse` modes (too easy to clash with user modes). - Functionality of force mode implemented using `cache=force`. +- **2012.02.05** + - Added `purge=yes|no` to control if the input file is deleted or not diff --git a/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv b/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv index 74998c2e18c..e5faaf99b80 100644 --- a/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv +++ b/Master/texmf-dist/tex/context/third/filter/t-filter.mkiv @@ -1,6 +1,6 @@ %D \module %D [ file=t-filter, -%D version=2012.01.26, +%D version=2012.02.11, %D title=\CONTEXT\ User Module, %D subtitle=Filter, %D author=Aditya Mahajan, @@ -9,7 +9,7 @@ %D email=adityam <at> ieee <dot> org, %D license=Simplified BSD License] -\writestatus{loading}{Filter (ver: 2012.01.26)} +\writestatus{loading}{Filter (ver: 2012.02.11)} % For backward compatibility \ifx\grabbufferdata\undefined \let\grabbufferdata \dostartbuffer \fi @@ -30,6 +30,7 @@ \setinterfaceconstant {filter} {filter} \setinterfaceconstant {filtercommand} {filtercommand} \setinterfaceconstant {output} {output} + \setinterfaceconstant {purge} {purge} \setinterfaceconstant {read} {read} \setinterfaceconstant {readcommand} {readcommand} \setinterfaceconstant {taglabel} {taglabel} @@ -174,9 +175,9 @@ \externalfilter@set_directory \ifthirdargument - \edef\externalfilter@buffer_name{\externalfilter@temp_prefix-\currentexternalfilter-#3} + \edef\externalfilter@buffer_name{#3} \else - \edef\externalfilter@buffer_name{\externalfilter@temp_prefix-\currentexternalfilter-#2} + \edef\externalfilter@buffer_name{#2} \fi \externalfilter@set_filenames_extras @@ -240,6 +241,10 @@ \endlinechar\minusone %to prevent line break after reading file \externalfilter@read_processed_file + \iftraceexternalfilters \else + \doif{\externalfilterparameter\c!purge}\v!yes + {\ctxlua{os.remove(\!!bs\externalfilter@input_file\!!es)}} + \fi % Finalization \doifinset{\externalfilterparameter\c!cache}{\v!yes,\v!force} {\doglobal\expandafter\increment\csname\externalfilter@count\endcsname} @@ -362,11 +367,15 @@ \externalfilter@execute_filter \externalfilter@read_processed_file - \endgroup + \iftraceexternalfilters \else + \doif{\externalfilterparameter\c!purge}\v!yes + {\ctxlua{os.remove(\!!bs\externalfilter@input_file\!!es)}} + \fi % Finalization \doifinset{\externalfilterparameter\c!cache}{\v!yes,\v!force} {\doglobal\expandafter\increment\csname\externalfilter@count\endcsname} + \endgroup \expanded{\checknextindentation[\externalfilterparameter\c!indentnext]} \dorechecknextindentation @@ -390,7 +399,6 @@ \!!bs\externalfilterparameter\c!filtercommand\!!es)}}} {\executesystemcommand {\externalfilterparameter\c!filtercommand}} - \iftraceexternalfilters \else \ctxlua{os.remove(\!!bs\externalfilter@input_file\!!es)} \fi \stoptexdefinition %D \subsubject {Read output} @@ -436,6 +444,7 @@ \c!read=\v!yes, \c!readcommand=\ReadFile, \c!directory=, + \c!purge=\v!yes, \c!output=\externalfilterbasefile.tex, \c!filter=, \c!filtercommand={\externalfilterparameter\c!filter\space \externalfilter@input_file}, |