summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/regi-ini.mkiv
blob: ef269985c7684fb44d8eae409b05d20a8722f28f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
%D \module
%D   [       file=char-reg,
%D        version=2005.04.25,
%D          title=\CONTEXT\ Lua Macros,
%D       subtitle=Regime Support,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright=PRAGMA]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\unprotect

%D First some initialization code:

\registerctxluafile{regi-ini}{1.001}

\def\mkloadregime   #1{\ctxlua{regimes.load("#1")}}
\def\mkenableregime #1{\ctxlua{regimes.enable("#1")}}
\def\mkdisableregime  {\ctxlua{regimes.disable()}}
\def\mkshowregime   #1{\ctxlua{regimes.context.show("#1")}}

\appendtoks
  \pushmacro\currentregime
  \disableregime
\to \everystartreadingfile

\appendtoks
  \popmacro\currentregime
  \enableregime[\currentregime]%
\to \everystopreadingfile

\protect \endinput

% \starttext
%     \showregimetable{cp1250}
% \stoptext