diff options
Diffstat (limited to 'tex/context/base/luat-cnf.lua')
-rw-r--r-- | tex/context/base/luat-cnf.lua | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/tex/context/base/luat-cnf.lua b/tex/context/base/luat-cnf.lua index fba2b71d1..0f721a874 100644 --- a/tex/context/base/luat-cnf.lua +++ b/tex/context/base/luat-cnf.lua @@ -7,7 +7,9 @@ if not modules then modules = { } end modules ['luat-cnf'] = { } local type, next, tostring, tonumber = type, next, tostring, tonumber -local format, concat, find = string.format, table.concat, string.find +local format, concat, find, lower, gsub = string.format, table.concat, string.find, string.lower, string.gsub + +local report = logs.reporter("system") local allocate = utilities.storage.allocate @@ -17,8 +19,8 @@ texconfig.shell_escape = 't' luatex = luatex or { } local luatex = luatex -texconfig.error_line = 79 -- 79 -- obsolete -texconfig.half_error_line = 50 -- 50 -- obsolete +texconfig.error_line = 1000 -- 79 -- obsolete +texconfig.half_error_line = 500 -- 50 -- obsolete texconfig.expand_depth = 10000 -- 10000 texconfig.hash_extra = 100000 -- 0 @@ -28,25 +30,9 @@ texconfig.max_print_line = 10000 -- 79 texconfig.max_strings = 500000 -- 15000 texconfig.param_size = 25000 -- 60 texconfig.save_size = 50000 -- 4000 +texconfig.save_size = 100000 -- 4000 texconfig.stack_size = 10000 -- 300 --- local function initialize() --- local t, variable = allocate(), resolvers.variable --- for name, default in next, variablenames do --- local name = variablenames[i] --- local value = variable(name) --- value = tonumber(value) --- if not value or value == "" or value == 0 then --- value = default --- end --- texconfig[name], t[name] = value, value --- end --- initialize = nil --- return t --- end --- --- luatex.variables = initialize() - local stub = [[ -- checking @@ -183,18 +169,39 @@ local variablenames = { local function makestub() name = name or (environment.jobname .. ".lui") + report("creating stub file %a using directives:",name) + report() firsttable = firsttable or lua.firstbytecode local t = { "-- this file is generated, don't change it\n", "-- configuration (can be overloaded later)\n" } - for _,v in next, variablenames do + for i=1,#variablenames do + local v = variablenames[i] + local d = "luatex." .. gsub(lower(v),"[^%a]","") + local dv = directives.value(d) local tv = texconfig[v] - if tv and tv ~= "" then + if dv then + if not tv then + report(" %s = %s (%s)",d,dv,"configured") + tv = dv + elseif tonumber(dv) >= tonumber(tv) then + report(" %s = %s (%s)",d,dv,"overloaded") + tv = dv + else + report(" %s = %s (%s)",d,tv,"preset kept") + end + elseif tv then + report(" %s = %s (%s)",d,tv,"preset") + else + report(" %s = <unset>",d) + end + if tv then t[#t+1] = format("texconfig.%s=%s",v,tv) end end io.savedata(name,format("%s\n\n%s",concat(t,"\n"),format(stub,firsttable))) + logs.newline() end lua.registerfinalizer(makestub,"create stub file") |