diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2009-08-23 11:11:32 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2009-08-23 11:11:32 +0000 |
commit | 8fc3039c82d48605b5ca8b2eda3f4fdd755681e1 (patch) | |
tree | 3cd9bbdd599bc4d1ac0409e167fee2136e4c0ec9 /Master/texmf-dist/tex/context/base/filt-ini.mkii | |
parent | 850fc99b7cd3ae7a20065531fe866ff7bae642ec (diff) |
this is context 2009.08.19 17:10
git-svn-id: svn://tug.org/texlive/trunk@14827 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/filt-ini.mkii')
-rw-r--r-- | Master/texmf-dist/tex/context/base/filt-ini.mkii | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/filt-ini.mkii b/Master/texmf-dist/tex/context/base/filt-ini.mkii new file mode 100644 index 00000000000..6e1a16e9ae6 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/filt-ini.mkii @@ -0,0 +1,121 @@ +%D \module +%D [ file=filt-ini, +%D version=2000.09.19, +%D title=\CONTEXT\ Filter Macros, +%D subtitle=Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Filter Macros / Initialization} + +% \ifx\OmegaVersion\undefined + +% \let\definefiltersynonym \gobbledoubleempty +% \let\definefiltersequence \gobbledoubleempty +% \unexpanded\def\usefiltersequence {\gobblesingleempty} +% \let\usefilter \gobblesingleempty +% \let\truefiltername \gobbleoneargument + +% \expandafter \endinput +% \fi + +\unprotect + +%D The real work starts here. + +% We need the {\??ot::#1} check because otherwise aleph will crash. Taco's +% torture test: +% +% \ocp\ArabicContext = contextual +% +% \dorecurse {5000} { +% \message{[\recurselevel]} +% \ocplist\Arabic=\addbeforeocplist 1 \ArabicContext \nullocplist +% } + +%D \macros +%D {definefiltersynonym} + +\def\definefiltersynonym + {\dodoubleargument\dodefinefiltersynonym} + +\def\dodefinefiltersynonym[#1][#2]% + {\setvalue{\??or#1}{#2}} + +%D \macros +%D {truefiltername} + +\def\truefiltername#1% + {\ifundefined{\??or#1}#1\else\truefiltername{\getvalue{\??or#1}}\fi} + +%D \macros +%D {definefiltersequence} + +\def\definefiltersequence + {\dodoubleargument\dodefinefiltersequence} + +% \def\dodefinefiltersequence[#1][#2]% +% {\setvalue{\??ot#1}{#2}} + +\def\dodefinefiltersequence[#1][#2]% + {\setxvalue{\??ot#1}{#2}% + \letgvalue{\??ot::#1}\v!stop} + +%D \macros +%D {usefiltersequence} +%D + +\def\magicocpnumber{1} + +% one can do: +% +% \definefiltersequence +% [farsi] +% [utf8 to unicode16=>5, +% persian fix, +% arabic analysis=>3, +% arabic glyphs] +% +% so, => is used to signal a priority + +\def\dodousefiltersequence#1% + {\expandafter\ocp\csname\??or:#1\endcsname=\truefiltername{#1}\relax + \splitstring#1\at=>\to\!!stringa\and\!!stringb + \edef\!!stringb{\number\ifx\!!stringb\empty\magicocpnumber\else\!!stringb\fi}% + \appendetoks + \noexpand\addbeforeocplist + \!!stringb\space + \expandafter\noexpand\csname\??or:\!!stringa\endcsname + \to \scratchtoks} + +\unexpanded\def\usefiltersequence[#1]% + {\doifdefined{\??ot::#1}% + {\doifvalue{\??ot::#1}\v!stop + {\scratchtoks\emptytoks + \expanded{\processcommalist[\getvalue{\??ot#1}]}\dodousefiltersequence + \expanded{\global\ocplist\csname\??ot:#1\endcsname=\the\scratchtoks}\nullocplist + \letgvalue{\??ot::#1}\v!start}% + \expanded{\pushocplist\csname\??ot:#1\endcsname}\relax}} + +%D \macros +%D {usefilter} + +\def\dousefilter#1% + {\doifundefined{\c!file\f!filterprefix#1}% + {\letvalue{\c!file\f!filterprefix#1}\empty + \makeshortfilename[\truefilename{\f!filterprefix#1}]% + \startreadingfile + \readsysfile{\shortfilename.mkii} + {\showmessage\m!filters1{#1}} + {\showmessage\m!filters2{#1}}% + \stopreadingfile}} + +\def\usefilter[#1]% + {\processcommalist[#1]\dousefilter} + +\protect \endinput |