%D \module
%D   [       file=core-def,
%D        version=2002.05.07,
%D          title=\CONTEXT\ Core Macros,
%D       subtitle=Defaults,
%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 Core Macros / Defaults}

%D Here we collect settings that cannot be done earlier due to
%D depedencies. More code will moved to this module later.

\unprotect

\usesymbols[mis,mvs] % 'glm' no longer needed due to lm

\usesymbols[nav] \setupsymbolset[navigation 1]

\setupinteraction[\c!symbolset=navigation 1]

% initialization order:

%appendtoks  \initializeluainstances               \to \everyjob
\appendtoks  \showcontextbanner                    \to \everyjob
\appendtoks  \initializenewlinechar                \to \everyjob
\appendtoks  \checksystemcommandmode               \to \everyjob
\appendtoks  \calculatecurrenttime                 \to \everyjob
\appendtoks  \loadsystemfiles                      \to \everyjob

\appendtoks  \loadoptionfile                       \to \everyjob % can load files !

\appendtoks  \preloadfonts                         \to \everyjob
\appendtoks  \settopskip                           \to \everyjob
\appendtoks  \preloadlanguages                     \to \everyjob
\appendtoks  \preloadspecials                      \to \everyjob
\appendtoks  \openspecialfile                      \to \everyjob
\appendtoks  \openutilities                        \to \everyjob
\appendtoks  \splitjobfilename                     \to \everyjob
\appendtoks  \checknotes                           \to \everyjob % depends on bodyfont
\appendtoks  \initializeMPgraphics                 \to \everyjob % after loading system files
\appendtoks  \reportsystemcommandmode              \to \everyjob
\appendtoks  \initializemainlanguage               \to \everyjob
\appendtoks  \settrue\trackfilenames               \to \everyjob
\appendtoks  \newbackgroundfalse                   \to \everyjob % global

\ifdefined\initializepagecounters
    \appendtoks \initializepagecounters            \to \everyjob
\fi

\appendtoks  \directsetup{*runtime:options}        \to \everyjob % we could erase them afterwards % order can change
\appendtoks  \directsetup{*runtime:modules}        \to \everyjob % we could erase them afterwards % order can change

\appendtoks  \checkpreprocessor                    \to \everyjob

%appendtoks  \page[\v!last] \page                  \to \everybye % moved to core-job, we need to do this cleaner
\appendtoks  \ifarrangingpages\poparrangedpages\fi \to \everybye
\appendtoks  \registerfileinfo[end]\jobname        \to \everybye
\appendtoks  \savenofpages                         \to \everybye
\appendtoks  \savenofsubpages                      \to \everybye

\appendtoks  \closeutilities                       \to \everygoodbye
\appendtoks  \stopcopyingblocks                    \to \everygoodbye
\appendtoks  \closespecialfile                     \to \everygoodbye

\prependtoks \resetutilities                       \to \everystarttext % moved 28-02-2002
\prependtoks \loadtwopassdata                      \to \everystarttext % moved 28-02-2002
\appendtoks  \checkreferences                      \to \everystarttext % new   04-12-1999

% \appendtoks\everyjob\expandafter{\the\everyjob\checkpreprocessor}\to\everydump

% temporary here:

% \in \at \about \from \over

\unexpanded\def\arg{\mathortext\normalmatharg\normaltextarg}

% brrr
% normally one does not want this to happen nested, maybe there
% is more; non public vars btw, will become conditionals

\ifx\writetoregisterfalse\undefined \else \appendtoks \writetoregisterfalse \to \everybeforeutilityread \fi
\ifx\writetolistfalse    \undefined \else \appendtoks \writetolistfalse     \to \everybeforeutilityread \fi
\ifx\notesenabledfalse   \undefined \else \appendtoks \notesenabledfalse    \to \everybeforeutilityread \fi

\def\synctexwarning
  {\ifdefined\synctex \ifnum\synctex=\zerocount \else
     \writeline
     \writestatus\m!systems{BEWARE: synctex functionality is enabled!}%
     \writeline
     \globallet\synctexwarning\relax
   \fi \fi}

\prependtoks \synctexwarning \to \everyjob
\prependtoks \synctexwarning \to \everystarttext
\appendtoks  \synctexwarning \to \everystoptext

% last minute hacks

\protect \endinput
