diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-02-21 19:26:29 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-02-21 19:26:29 +0100 |
commit | 8e51addbcecd962280c24a77de9ec1f6724e7a65 (patch) | |
tree | 6a0f3b7ba546826e0864909da326df101068c5b8 /tex/context/base/mkiv/regi-ini.lua | |
parent | 9bb459e9fedcad94579973ccd07ad9e78d0734c8 (diff) | |
download | context-8e51addbcecd962280c24a77de9ec1f6724e7a65.tar.gz |
2018-02-21 18:27:00
Diffstat (limited to 'tex/context/base/mkiv/regi-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/regi-ini.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/regi-ini.lua b/tex/context/base/mkiv/regi-ini.lua index be8fa1b1c..7691e8765 100644 --- a/tex/context/base/mkiv/regi-ini.lua +++ b/tex/context/base/mkiv/regi-ini.lua @@ -12,6 +12,8 @@ if not modules then modules = { } end modules ['regi-ini'] = { runtime.</p> --ldx]]-- +-- Todo: use regi-imp*.lua instead + local commands, context = commands, context local utfchar = utf.char @@ -134,6 +136,9 @@ end setmetatableindex(mapping, loadregime) setmetatableindex(backmapping,loadreverse) +regimes.mapping = mapping +regimes.backmapping = backmapping + local function fromregime(regime,line) if line and #line > 0 then local map = mapping[regime and synonyms[regime] or regime or currentregime] @@ -251,6 +256,22 @@ end regimes.push = push regimes.pop = pop +function regimes.list() + local name = resolvers.findfile(format("regi-ini.lua",regime)) or "" + local okay = { } + if name then + local list = dir.glob(file.join(file.dirname(name),"regi-*.lua")) + for i=1,#list do + local name = list[i] + if name ~= "regi-ini.lua" then + okay[#okay+1] = match(name,"regi%-(.-)%.lua") + end + table.sort(okay) + end + end + return okay +end + if sequencers then sequencers.prependaction(textlineactions,"system","regimes.process") |