diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua index 6de95199884..6d202ff5aa9 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua @@ -18,7 +18,7 @@ if not modules then modules = { } end modules ['lang-ini'] = { -- todo: no foo:bar but foo(bar,...) -local type, tonumber = type, tonumber +local type, tonumber, next = type, tonumber, next local utfbyte = utf.byte local format, gsub, gmatch, find = string.format, string.gsub, string.gmatch, string.find local concat, sortedkeys, sortedpairs, keys, insert = table.concat, table.sortedkeys, table.sortedpairs, table.keys, table.insert @@ -270,6 +270,8 @@ local function unique(tag,requested,loaded) end end +local shared = false + local function loaddefinitions(tag,specification) statistics.starttiming(languages) local data, instance = resolve(tag) @@ -295,6 +297,19 @@ local function loaddefinitions(tag,specification) local ok = false local resources = data.resources or { } data.resources = resources + if not shared then + local found = resolvers.findfile("lang-exc.lua") + if found then + shared = dofile(found) + if type(shared) == "table" then + shared = concat(shared," ") + else + shared = true + end + else + shared = true + end + end for i=1,#definitions do local definition = definitions[i] if definition == "" then @@ -344,13 +359,18 @@ local function loaddefinitions(tag,specification) end end if #ploaded > 0 then + -- why not always clear instance:clear_patterns() instance:patterns(unique(tag,requested,ploaded)) end if #eloaded > 0 then + -- why not always clear instance:clear_hyphenation() instance:hyphenation(concat(eloaded," ")) end + if type(shared) == "string" then + instance:hyphenation(shared) + end return ok elseif trace_patterns then report_initialization("no definitions for language %a",tag) |