--- scrn-int.mkiv.org 2011-01-31 13:26:23.000000000 +0300 +++ scrn-int.mkiv 2011-02-23 12:34:22.000000000 +0300 @@ -405,6 +405,25 @@ % % \setupattachments[\c!symbol={symbol-normal,symbol-down}] % % \starttext \attachment[whatever] \stoptext +% +% \globattachment[test.tex] +% \globattachment[description][test.tex] +% \globattachment[description][newname.tex][test.tex] + +\def\globattachment + {\dotripleempty\doglobattachment} + +\def\doglobattachment[#1][#2][#3]% description newfilename filename + {\ifthirdargument + \dodoglobattachment{#1}{#2}{#3}% + \else\ifsecondargument + \dodoglobattachment{#1}{}{#2}% + \else + \dodoglobattachment{}{}{#1}% + \fi\fi} + +\def\dodoglobattachment#1#2#3% description newfilename filename + {\ctxlua{backends.codeinjections.globattachfile{description="#1",newname="#2",filename="#3"}}} \def\useattachment {\doquadrupleempty\douseattachment}