summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/regi-ini.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/regi-ini.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/regi-ini.mkiv52
1 files changed, 34 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/context/base/regi-ini.mkiv b/Master/texmf-dist/tex/context/base/regi-ini.mkiv
index ef269985c76..5a3be77a2c6 100644
--- a/Master/texmf-dist/tex/context/base/regi-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/regi-ini.mkiv
@@ -1,7 +1,7 @@
%D \module
-%D [ file=char-reg,
+%D [ file=regi-ini,
%D version=2005.04.25,
-%D title=\CONTEXT\ Lua Macros,
+%D title=\CONTEXT\ Regime Macros,
%D subtitle=Regime Support,
%D author=Hans Hagen,
%D date=\currentdate,
@@ -17,23 +17,39 @@
\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")}}
+%D \macros
+%D {currentregime}
-\appendtoks
- \pushmacro\currentregime
- \disableregime
-\to \everystartreadingfile
+\def\currentregime{utf}
-\appendtoks
- \popmacro\currentregime
- \enableregime[\currentregime]%
-\to \everystopreadingfile
+%D \macros
+%D {defineregimesynonym,trueregimename}
-\protect \endinput
+\def\defineregimesynonym
+ {\dodoubleargument\dodefineregimesynonym}
+
+\def\dodefineregimesynonym[#1][#2]%
+ {\ctxlua{regimes.setsynonym("#1","#2")}}
+
+\def\trueregimename#1%
+ {\ctxlua{regimes.truename("#1")}}
+
+%D \macros
+%D {useregime}
+
+\def\useregime[#1]%
+ {\processcommalist[#1]\douseregime}
-% \starttext
-% \showregimetable{cp1250}
-% \stoptext
+\def\douseregime#1%
+ {\ctxlua{regimes.load("#1")}}
+
+%D \macros
+%D {enableregime,disableregime}
+
+\def\enableregime[#1]%
+ {\edef\currentregime{\ctxlua{regimes.load("#1") regimes.enable("#1") regimes.truename()}}}
+
+\def\disableregime
+ {\edef\currentregime{\ctxlua{regimes.disable()}}}
+
+\protect \endinput