%D \module
%D   [       file=node-ini,
%D        version=2006.08.20,
%D          title=\CONTEXT\ Node Macros,
%D       subtitle=Initialization,
%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 Node Support / Initialization}

\unprotect

\newinteger\filterstate \filterstate\plusone % hm, public

\registerctxluafile{node-cmp}{autosuffix}
\registerctxluafile{node-ini}{autosuffix}
\registerctxluafile{node-met}{autosuffix}
\registerctxluafile{node-nut}{autosuffix}
\registerctxluafile{node-res}{autosuffix}
%registerctxluafile{node-ppt}{} % experimental, not used so probably useless
\registerctxluafile{node-aux}{autosuffix}
\registerctxluafile{node-gcm}{autosuffix}
\registerctxluafile{node-tst}{autosuffix}
\registerctxluafile{node-tra}{autosuffix}
\registerctxluafile{node-snp}{autosuffix}
\registerctxluafile{node-tsk}{autosuffix}
\registerctxluafile{node-tex}{autosuffix}
\registerctxluafile{node-dir}{autosuffix}
\registerctxluafile{node-pro}{autosuffix}
\registerctxluafile{node-ser}{autosuffix}
%registerctxluafile{node-acc}{autosuffix} % now a backend task
%registerctxluafile{node-prp}{} % makes no sense (yet)
\registerctxluafile{node-scn}{autosuffix}
\registerctxluafile{node-scn}{autosuffix}
\registerctxluafile{node-par}{autosuffix}
%registerctxluafile{node-bwc}{autosuffix} % no longer used

%D This might go away (needs checking anyway, very old code):

\newinteger\c_node_tracers_show_box % box number

\permanent\protected\def\shownextnodes{\afterassignment\node_tracers_show_next\c_node_tracers_show_box}
\permanent\protected\def\showflatnodes{\afterassignment\node_tracers_show_flat\c_node_tracers_show_box}

\def\node_tracers_show_next{\ctxlua{texio.write_nl('log',nodes.serializebox(\the\c_node_tracers_show_box,false,true))}}
\def\node_tracers_show_flat{\ctxlua{texio.write_nl('log',nodes.serializebox(\the\c_node_tracers_show_box,true, true))}}

\permanent\protected\def\visualizenextnodes{\dowithnextbox{\ctxlua{nodes.visualizebox(\the\nextbox,false,true)}}}
\permanent\protected\def\visualizeflatnodes{\dowithnextbox{\ctxlua{nodes.visualizebox(\the\nextbox,true,true)}}}

\protect \endinput
