%D \module
%D   [       file=trac-ctx,
%D        version=2012.07.13,
%D          title=\CONTEXT\ Tracing Macros,
%D       subtitle=TeX Trackers,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%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 Tracing Macros / TeX Trackers}

\registerctxluafile{trac-ctx}{}

\unprotect

\permanent\protected\def\installtextracker   #1#2#3{\clf_installtextracker   {#1}{\detokenize{#2}}{\detokenize{#3}}}
\permanent\protected\def\installtexdirective #1#2#3{\clf_installtexdirective {#1}{\detokenize{#2}}{\detokenize{#3}}}
\permanent\protected\def\installtexexperiment#1#2#3{\clf_installtexexperiment{#1}{\detokenize{#2}}{\detokenize{#3}}}

\appendtoks
    \clf_initializetextrackers
    \clf_initializetexdirectives
    \clf_initializetexexperiments
\to \everyjob

% \pushoverloadmode
%
% \let\syst_beginsimplegroup_yes\beginsimplegroup
% \let\syst_beginsimplegroup_nop\bgroup
%
% \let\beginsimplegroup\syst_beginsimplegroup_nop
%
% \installtexexperiment
%   {simplegroups}
%   {\enforced\let\beginsimplegroup\syst_beginsimplegroup_yes}
%   {\enforced\let\beginsimplegroup\syst_beginsimplegroup_nop}
%
% \popoverloadmode

\protect \endinput

% this is one option:
%
% \newconditional\c_math_virtual_tx
% \newconditional\c_math_virtual_px
% \newconditional\c_math_virtual_lm
%
% \installtexdirective {fonts.math.virtual.tx} {\c_math_virtual_tx\conditionaltrue} {\c_math_virtual_tx\conditionalfalse}
% \installtexdirective {fonts.math.virtual.px} {\c_math_virtual_px\conditionaltrue} {\c_math_virtual_px\conditionalfalse}
% \installtexdirective {fonts.math.virtual.lm} {\c_math_virtual_lm\conditionaltrue} {\c_math_virtual_lm\conditionalfalse}
%
% but as it makes the typescript look ugly we wil use:
%
% \installtexdirective {fonts.math.virtual.tx} {\enablemode[fonts.math.virtual.tx]} {\disablemode[fonts.math.virtual.tx]}
% \installtexdirective {fonts.math.virtual.px} {\enablemode[fonts.math.virtual.px]} {\disablemode[fonts.math.virtual.px]}
% \installtexdirective {fonts.math.virtual.lm} {\enablemode[fonts.math.virtual.lm]} {\disablemode[fonts.math.virtual.lm]}
%
% which could be:
%
% \def\mode_f_m_v_tx{fonts.math.virtual.tx}
% \def\mode_f_m_v_px{fonts.math.virtual.px}
% \def\mode_f_m_v_lm{fonts.math.virtual.lm}
%
% \installtexdirective \mode_f_m_v_tx {\enablemode[\mode_f_m_v_tx]} {\disablemode[\mode_f_m_v_tx]}
% \installtexdirective \mode_f_m_v_px {\enablemode[\mode_f_m_v_px]} {\disablemode[\mode_f_m_v_px]}
% \installtexdirective \mode_f_m_v_lm {\enablemode[\mode_f_m_v_lm]} {\disablemode[\mode_f_m_v_lm]}
%
% alas .. we don't want to define this in the core
