From f3cbe661ac115c29ab8c0674fc857d3331d5d4cc Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 24 Dec 2013 19:00:25 +0200 Subject: beta 2013.12.24 17:52 --- scripts/context/lua/mtxrun.lua | 26 ++++++--- scripts/context/stubs/mswin/mtxrun.lua | 26 ++++++--- scripts/context/stubs/unix/mtxrun | 26 ++++++--- tex/context/base/buff-ver.lua | 30 +++++----- tex/context/base/buff-ver.mkiv | 64 ++++++++++++++++----- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4127 -> 4110 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/l-table.lua | 9 ++- tex/context/base/l-unicode.lua | 11 +++- tex/context/base/meta-ini.mkiv | 21 ++++++- tex/context/base/mlib-pps.lua | 59 +++++++++++-------- tex/context/base/mult-def.mkiv | 1 + tex/context/base/status-files.pdf | Bin 24635 -> 24627 bytes tex/context/base/status-lua.pdf | Bin 228090 -> 228242 bytes tex/context/base/syst-aux.lua | 5 ++ tex/context/base/syst-aux.mkiv | 22 ++++--- tex/generic/context/luatex/luatex-fonts-merged.lua | 11 ++-- 18 files changed, 222 insertions(+), 93 deletions(-) diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index eda9f9185..24596bf87 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -1172,7 +1172,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 31038, stripped down to: 20207 +-- original size: 31113, stripped down to: 20256 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1286,10 +1286,13 @@ local function sortedhash(t,cmp) s=sortedkeys(t) end local n=0 + local m=#s local function kv(s) - n=n+1 - local k=s[n] - return k,t[k] + if n 0 then - makempy.nofconverted = makempy.nofconverted + 1 - starttiming(makempy) - local mpofile = tex.jobname .. "-mpgraph" - local mpyfile = file.replacesuffix(mpofile,"mpy") - local pdffile = file.replacesuffix(mpofile,"pdf") - local texfile = file.replacesuffix(mpofile,"tex") - io.savedata(texfile, { start, preamble, metapost.tex.get(), concat(graphics,"\n"), stop }, "\n") - local command = format("context --once %s %s", (tex.interactionmode == 0 and "--batchmode") or "", texfile) + if #graphics == 0 then + return + end + if mpyfilename and io.exists(mpyfilename) then + report_metapost("using file: %s",mpyfilename) + return + end + makempy.nofconverted = makempy.nofconverted + 1 + starttiming(makempy) + local mpofile = tex.jobname .. "-mpgraph" + local mpyfile = file.replacesuffix(mpofile,"mpy") + local pdffile = file.replacesuffix(mpofile,"pdf") + local texfile = file.replacesuffix(mpofile,"tex") + io.savedata(texfile, { start, preamble, metapost.tex.get(), concat(graphics,"\n"), stop }, "\n") + local command = format("context --once %s %s", (tex.interactionmode == 0 and "--batchmode") or "", texfile) + os.execute(command) + if io.exists(pdffile) then + command = format("pstoedit -ssp -dt -f mpost %s %s", pdffile, mpyfile) + logs.newline() + report_metapost("running: %s",command) + logs.newline() os.execute(command) - if io.exists(pdffile) then - command = format("pstoedit -ssp -dt -f mpost %s %s", pdffile, mpyfile) - logs.newline() - report_metapost("running: %s",command) - logs.newline() - os.execute(command) + if io.exists(mpyfile) then local result, r = { }, 0 - if io.exists(mpyfile) then - local data = io.loaddata(mpyfile) - if data and #data > 0 then - for figure in gmatch(data,"beginfig(.-)endfig") do - r = r + 1 - result[r] = formatters["begingraphictextfig%sendgraphictextfig ;\n"](figure) - end - io.savedata(mpyfile,concat(result,"")) + local data = io.loaddata(mpyfile) + if data and #data > 0 then + for figure in gmatch(data,"beginfig(.-)endfig") do + r = r + 1 + result[r] = formatters["begingraphictextfig%sendgraphictextfig ;\n"](figure) end + io.savedata(mpyfile,concat(result,"")) end end - stoptiming(makempy) end + stoptiming(makempy) end -- -- the new plugin handler -- -- diff --git a/tex/context/base/mult-def.mkiv b/tex/context/base/mult-def.mkiv index 3d480e187..85ce5d2cb 100644 --- a/tex/context/base/mult-def.mkiv +++ b/tex/context/base/mult-def.mkiv @@ -35,6 +35,7 @@ % start todo: \def\c!fences {fences} +\def\c!keeptogether {keeptogether} \def\c!sectionblock {sectionblock} \def\c!language {language} diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index ffa1b6e2c..59f96fc11 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/status-lua.pdf b/tex/context/base/status-lua.pdf index 11aabfd82..99338da8c 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/syst-aux.lua b/tex/context/base/syst-aux.lua index 9ef28996a..6b5e18d16 100644 --- a/tex/context/base/syst-aux.lua +++ b/tex/context/base/syst-aux.lua @@ -108,3 +108,8 @@ local pattern = Cs( function commands.thetexdefinition(str) context(lpegmatch(pattern,str)) end + +local upper, lower = utf.upper, utf.lower + +function commands.upper(s) context(upper(s)) end +function commands.lower(s) context(lower(s)) end diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv index 8e02432c9..c7be461a3 100644 --- a/tex/context/base/syst-aux.mkiv +++ b/tex/context/base/syst-aux.mkiv @@ -5470,7 +5470,7 @@ %D We have to use a two||step implementation, because the %D expansion has to take place outside \type{\uppercase}. %D -%D These might up as \LUA based helpers (i.e. considere these +%D These might end up as \LUA based helpers (i.e. consider these %D obsolete: \unexpanded\def\syst_helpers_do_IF#1#2% @@ -5892,7 +5892,7 @@ \ifdefined\normalquitvmode \let\dontleavehmode\normalquitvmode \fi %D \macros -%D {uppercasestring,lowercasestring} +%D {utfupper, utflower, uppercasestring, lowercasestring} %D %D The names tell what they do: %D @@ -5903,14 +5903,20 @@ %D %D The first argument may be a \type{\macro}. -\unexpanded\def\uppercasestring#1\to#2% - {\uppercase\expandafter{\expandafter\dodoglobal\expandafter\edef\expandafter#2\expandafter{\normalexpanded{#1}}}} - -\unexpanded\def\lowercasestring#1\to#2% - {\lowercase\expandafter{\expandafter\dodoglobal\expandafter\edef\expandafter#2\expandafter{\normalexpanded{#1}}}} +% \unexpanded\def\uppercasestring#1\to#2% +% {\uppercase\expandafter{\expandafter\dodoglobal\expandafter\edef\expandafter#2\expandafter{\normalexpanded{#1}}}} +% +% \unexpanded\def\lowercasestring#1\to#2% +% {\lowercase\expandafter{\expandafter\dodoglobal\expandafter\edef\expandafter#2\expandafter{\normalexpanded{#1}}}} %D These macros are sort of obsolete as we never use uppercase this -%D way. +%D way. But nevertheless we provide them: + +\def\utfupper#1{\ctxcommand{upper(\!!bs#1\!!es)}} % expandable +\def\utflower#1{\ctxcommand{lower(\!!bs#1\!!es)}} % expandable + +\unexpanded\def\uppercasestring#1\to#2{\dodoglobal\edef#2{\ctxcommand{upper(\!!bs#1\!!es)}}} +\unexpanded\def\lowercasestring#1\to#2{\dodoglobal\edef#2{\ctxcommand{lower(\!!bs#1\!!es)}}} %D \macros %D {handletokens} diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index bf787ba6d..177324145 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 12/22/13 19:05:41 +-- merge date : 12/24/13 17:52:44 do -- begin closure to overcome local limits and interference @@ -922,10 +922,13 @@ local function sortedhash(t,cmp) s=sortedkeys(t) end local n=0 + local m=#s local function kv(s) - n=n+1 - local k=s[n] - return k,t[k] + if n