From a7783195bba6e02d950920c75fe49ac0ee4f0e07 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 5 Jan 2012 19:27:26 +0100 Subject: beta 2011.11.14 16:17 --- tex/context/base/back-exp.lua | 2 +- tex/context/base/context-version.pdf | Bin 4114 -> 4118 bytes tex/context/base/context-version.png | Bin 105939 -> 106296 bytes tex/context/base/data-tex.lua | 12 ++++++++---- tex/context/base/file-job.mkvi | 2 +- tex/context/base/status-files.pdf | Bin 24141 -> 24136 bytes tex/context/base/util-seq.lua | 13 ++++++++----- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/tex/context/base/back-exp.lua b/tex/context/base/back-exp.lua index 98d87b1ee..6a05889c3 100644 --- a/tex/context/base/back-exp.lua +++ b/tex/context/base/back-exp.lua @@ -348,7 +348,7 @@ local function allusedstyles(xmlfile) -- result[#result+1] = format(documenttemplate,bodyfont,width,align,hyphen) -- - local colorspecification = xml.css.fontspecification + local colorspecification = xml.css.colorspecification local fontspecification = xml.css.fontspecification for element, details in sortedhash(usedstyles) do for detail, data in sortedhash(details) do diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index 802c3ea9a..2f9f24c95 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png index 727bfaf25..2429baea6 100644 Binary files a/tex/context/base/context-version.png and b/tex/context/base/context-version.png differ diff --git a/tex/context/base/data-tex.lua b/tex/context/base/data-tex.lua index bf4e30413..c2257296c 100644 --- a/tex/context/base/data-tex.lua +++ b/tex/context/base/data-tex.lua @@ -79,7 +79,7 @@ function helpers.textopener(tag,filename,filehandle,coding) lines = unicode.utf32_to_utf8_le(lines) else -- utf8 or unknown (could be a mkvi file) if textfileactions.dirty then -- maybe use autocompile - fileprocessor = sequencers.compile(textfileactions) + fileprocessor = sequencers.compile(textfileactions) -- no need for dummy test .. always one end lines = fileprocessor(lines,filename,coding) or lines lines = splitlines(lines) @@ -119,10 +119,14 @@ function helpers.textopener(tag,filename,filehandle,coding) -- elseif content == ctrl_d or ctrl_z then -- return nil -- we need this as \endinput does not work in prints else - if textlineactions.dirty then - lineprocessor = sequencers.compile(textlineactions) -- maybe use autocompile + if textlineactions.dirty then -- no dummy + lineprocessor = sequencers.compile(textlineactions,false,true) -- maybe use autocompile + end + if lineprocessor then + return lineprocessor(content,filename,currentline,noflines,coding) or content + else + return content end - return lineprocessor(content,filename,currentline,noflines,coding) or content end end end diff --git a/tex/context/base/file-job.mkvi b/tex/context/base/file-job.mkvi index a1a44608b..7f2c5b2fa 100644 --- a/tex/context/base/file-job.mkvi +++ b/tex/context/base/file-job.mkvi @@ -83,7 +83,7 @@ % document structure -\ifdefined\else \newcount\textlevel \fi % might go away +\ifdefined\textlevel\else \newcount\textlevel \fi % might go away \def\dostarttext {\glet\dostarttext\relax diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index a2a2bc19b..08d46ae7d 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/util-seq.lua b/tex/context/base/util-seq.lua index 22733b022..3c5dc8ebb 100644 --- a/tex/context/base/util-seq.lua +++ b/tex/context/base/util-seq.lua @@ -176,9 +176,10 @@ local function construct(t,nodummy) end end t.dirty = false - if nodummy and #calls == 0 then + if nodummy and n == 0 then return nil else + -- n == 0 we could just return the variables variables = concat(variables,"\n") calls = concat(calls,"\n") if results then @@ -190,19 +191,21 @@ local function construct(t,nodummy) end end -sequencers.tostring = construct +sequencers.tostring = function(s) return construct(s,true) end sequencers.localize = localize local function compile(t,compiler,n) + local compiled if not t or type(t) == "string" then -- weird ... t.compiled = t .. so return false elseif compiler then - t.compiled = compiler(t,n) + compiled = compiler(t,n) else - t.compiled = construct(t) + compiled = construct(t,n) end - local runner = loadstring(t.compiled)() + local runner = compiled and loadstring(compiled)() + t.compiled = compiled t.runner = runner return runner -- faster end -- cgit v1.2.3