diff options
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r-- | tex/context/base/mkiv/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/context.mkxl | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/lpdf-lmt.lmt | 4 | ||||
-rw-r--r-- | tex/context/base/mkiv/luat-fio.lmt | 90 | ||||
-rw-r--r-- | tex/context/base/mkiv/luat-fio.lua | 1 | ||||
-rw-r--r-- | tex/context/base/mkiv/luat-lib.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 28112 -> 27809 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 254795 -> 254762 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/trac-deb.lua | 48 | ||||
-rw-r--r-- | tex/context/base/mkiv/trac-deb.mkiv | 10 |
11 files changed, 154 insertions, 7 deletions
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index cead1eed6..52b08dcf1 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2020.07.22 10:51} +\newcontextversion{2020.07.22 21:15} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 81b89f509..70030293a 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -45,7 +45,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2020.07.22 10:51} +\edef\contextversion{2020.07.22 21:15} %D Kind of special: diff --git a/tex/context/base/mkiv/context.mkxl b/tex/context/base/mkiv/context.mkxl index 13b31cc27..7581dc085 100644 --- a/tex/context/base/mkiv/context.mkxl +++ b/tex/context/base/mkiv/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2020.07.22 10:51} +\edef\contextversion{2020.07.22 21:15} %D Kind of special: diff --git a/tex/context/base/mkiv/lpdf-lmt.lmt b/tex/context/base/mkiv/lpdf-lmt.lmt index 7e992f79e..48297846e 100644 --- a/tex/context/base/mkiv/lpdf-lmt.lmt +++ b/tex/context/base/mkiv/lpdf-lmt.lmt @@ -927,7 +927,7 @@ local flushrule, flushsimplerule, flushspecialrule, flushimage, flushgroup do local f_w = formatters["[] 0 d 0 J %.6N w 0 0 %.6N %.6N re S"] local f_b = formatters["%.6N w 0 %.6N %.6N %.6N re f"] - local f_f = formatters["[] 0 d 0 J %.6N w %.6N %.6N %.6N %.6N re S"] + local f_x = formatters["[] 0 d 0 J %.6N w %.6N %.6N %.6N %.6N re S"] -- Historically the index is an object which is kind of bad. @@ -1357,7 +1357,7 @@ local flushrule, flushsimplerule, flushspecialrule, flushimage, flushgroup do local rule if outline then - rule = f_f(line,half,-depth+half,width-line,total-line) + rule = f_x(line,half,-depth+half,width-line,total-line) else rule = f_b(line,-depth,width,total) end diff --git a/tex/context/base/mkiv/luat-fio.lmt b/tex/context/base/mkiv/luat-fio.lmt new file mode 100644 index 000000000..4ce981c48 --- /dev/null +++ b/tex/context/base/mkiv/luat-fio.lmt @@ -0,0 +1,90 @@ +if not modules then modules = { } end modules ['luat-fio'] = { + version = 1.001, + comment = "companion to luat-lib.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local format = string.format +local concat = table.concat + +texconfig.kpse_init = false -- can go away +texconfig.shell_escape = 't' -- can go away +texconfig.max_print_line = 100000 -- can go away +texconfig.max_in_open = 1000 -- can go away + +if not resolvers.initialized() then + + resolvers.reset() + + -- we now load the file database as we might need files other than + -- tex and lua file on the given path + + resolvers.load() + + if callback then + + local findbinfile = resolvers.findbinfile + local loadbinfile = resolvers.loadbinfile + local findtexfile = resolvers.findtexfile + local opentexfile = resolvers.opentexfile + local register = callbacks.register + + local ioflush = io.flush + local ioread = io.read + local writenl = texio.write_nl + + local function terminal() + writenl("\ntex console > ") + ioflush() + local line = ioread() + writenl("") + ioflush() + return line + end + + local function find_data_file(name, index) + if index == 0 then + return "terminal" + else + return findbinfile(name,"tex") + end + end + + local function open_data_file(name, index) + if index == 0 and name == "terminal" then + return { + reader = terminal, + noflines = 1, + filename = name, + } + else + return opentexfile(name) + end + end + + local function find_any_file(name) + return name + end + + register('find_data_file' , find_data_file, true) + register('open_data_file' , open_data_file, true) + register('find_log_file' , find_any_file, true) + register('find_format_file', find_any_file, true) + + end + +end + +statistics.register("resource resolver", function() + local scandata = resolvers.scandata() + return format("loadtime %s seconds, %s scans with scantime %s seconds, %s shared scans, %s found files, scanned paths: %s", + resolvers.loadtime(), + scandata.n, + scandata.time, + scandata.shared, + #resolvers.foundintrees(), + #scandata.paths > 0 and concat(scandata.paths," ") or "<none>" + ) +end) diff --git a/tex/context/base/mkiv/luat-fio.lua b/tex/context/base/mkiv/luat-fio.lua index 26db46a88..2418eec1b 100644 --- a/tex/context/base/mkiv/luat-fio.lua +++ b/tex/context/base/mkiv/luat-fio.lua @@ -8,7 +8,6 @@ if not modules then modules = { } end modules ['luat-fio'] = { local format = string.format local concat = table.concat -local sequenced = table.sequenced texconfig.kpse_init = false texconfig.shell_escape = 't' diff --git a/tex/context/base/mkiv/luat-lib.mkiv b/tex/context/base/mkiv/luat-lib.mkiv index a42d73f6d..4d3fd1823 100644 --- a/tex/context/base/mkiv/luat-lib.mkiv +++ b/tex/context/base/mkiv/luat-lib.mkiv @@ -79,7 +79,7 @@ \registerctxluafile{luat-cbk}{} \registerctxluafile{luat-run}{} -\registerctxluafile{luat-fio}{} +\registerctxluafile{luat-fio}{autosuffix} \registerctxluafile{luat-cnf}{} \registerctxluafile{luat-lua}{} \registerctxluafile{luat-sto}{} diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex ad9fe84a5..a2fbd86a7 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 5eb3b2c86..d95c43f54 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/trac-deb.lua b/tex/context/base/mkiv/trac-deb.lua index c219b3cbd..c5d0183ff 100644 --- a/tex/context/base/mkiv/trac-deb.lua +++ b/tex/context/base/mkiv/trac-deb.lua @@ -25,6 +25,8 @@ local report_str = logs.writer tracers = tracers or { } local tracers = tracers +-- this is old tracing stuff ... will go to its own module + tracers.lists = { } local lists = tracers.lists @@ -108,6 +110,52 @@ function tracers.knownlist(name) return l and #l > 0 end +-- till here + +-- for now here + +if CONTEXTLMTXMODE > 0 then + + local ioflush = io.flush + local ioread = io.read + local writenl = texio.write_nl + local write = texio.write + + local runtoks = tex.runtoks + local terminaldata = false + local context = context + + interfaces.implement { + name = "fetchterminaldata", + actions = function() + context(terminaldata) + end, + } + + function texio.terminal() + writenl("\n" .. "entering interactive mode, use \\quit to abort reading" .."\n\n") + while true do + write(">") + ioflush() + terminaldata = ioread() + if terminaldata == "\\quit" then + terminaldata = false + break + else + runtoks("t_syst_terminal_data",nil,nil,true) -- obeymode + end + end + end + + interfaces.implement { + name = "readfromterminal", + public = true, + protected = true, + actions = texio.terminal, + } + +end + local savedluaerror = nil local usescitelexer = nil local quitonerror = true diff --git a/tex/context/base/mkiv/trac-deb.mkiv b/tex/context/base/mkiv/trac-deb.mkiv index b5366d88c..fcf58f37f 100644 --- a/tex/context/base/mkiv/trac-deb.mkiv +++ b/tex/context/base/mkiv/trac-deb.mkiv @@ -40,4 +40,14 @@ % \enabledirectives[system.showerror] +\unprotect + +\ifcase\contextlmtxmode \else + \newtoks \t_syst_terminal_data + % \t_syst_terminal_data {\beginlocalcontrol\clf_fetchterminaldata\endlocalcontrol} + \t_syst_terminal_data {\clf_fetchterminaldata} +\fi + +\protect + \protect \endinput |