From a88d77afdd9ea519815a25698e446908aec42ff9 Mon Sep 17 00:00:00 2001
From: Hans Hagen <pragma@wxs.nl>
Date: Thu, 3 Dec 2009 00:41:00 +0100
Subject: beta 2009.12.03 00:41

---
 scripts/context/lua/mtx-context.lua        |  17 ++++++++++++-----
 scripts/context/lua/mtxrun.lua             |  15 ++++++++++-----
 scripts/context/stubs/mswin/context.exe    | Bin 5631 -> 5633 bytes
 scripts/context/stubs/mswin/luatools.exe   | Bin 5631 -> 5633 bytes
 scripts/context/stubs/mswin/metatex.exe    | Bin 5631 -> 5633 bytes
 scripts/context/stubs/mswin/mtxrun.dll     | Bin 7679 -> 7680 bytes
 scripts/context/stubs/mswin/mtxrun.exe     | Bin 5631 -> 5633 bytes
 scripts/context/stubs/mswin/mtxrun.lua     |  15 ++++++++++-----
 scripts/context/stubs/mswin/mtxworks.exe   | Bin 5631 -> 5633 bytes
 scripts/context/stubs/mswin/texexec.exe    | Bin 5631 -> 5633 bytes
 scripts/context/stubs/mswin/texmfstart.exe | Bin 5631 -> 5633 bytes
 scripts/context/stubs/unix/mtxrun          |  15 ++++++++++-----
 tex/context/base/enco-ffr.mkii             |   4 ++++
 tex/context/base/math-dim.lua              |   9 ++++++---
 tex/context/base/meta-ini.mkii             |   1 +
 tex/context/base/typo-mir.lua              |  14 ++++++--------
 16 files changed, 59 insertions(+), 31 deletions(-)

diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua
index c6d15a1b0..40ab67eff 100644
--- a/scripts/context/lua/mtx-context.lua
+++ b/scripts/context/lua/mtx-context.lua
@@ -674,11 +674,18 @@ function scripts.context.run(ctxdata,filename)
                 -- look at the first line
                 local a = analyze(filename)
                 if a and (a.engine == 'pdftex' or a.engine == 'xetex' or environment.argument("pdftex") or environment.argument("xetex")) then
-                    local texexec = resolvers.find_file("texexec.rb") or ""
-                    if texexec ~= "" then
-                        os.setenv("RUBYOPT","")
-                        local command = string.format("ruby %s %s",texexec,environment.reconstruct_commandline(environment.arguments_after))
-                        os.exec(command)
+                    if false then
+                        -- we need to write a top etc too and run mp etc so it's not worth the
+                        -- trouble, so it will take a while before the next is finished
+                        --
+                        -- require "mtx-texutil.lua"
+                    else
+                        local texexec = resolvers.find_file("texexec.rb") or ""
+                        if texexec ~= "" then
+                            os.setenv("RUBYOPT","")
+                            local command = string.format("ruby %s %s",texexec,environment.reconstruct_commandline(environment.arguments_after))
+                            os.exec(command)
+                        end
                     end
                 else
                     if a and a.interface and a.interface ~= interface then
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index 8e2524147..a1fc6eaf5 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -10750,10 +10750,11 @@ messages.help = [[
 --edit                launch editor with found file
 --launch (--all)      launch files like manuals, assumes os support
 
---intern              run script using built in libraries
+--internal            run script using built in libraries (same as --ctxlua)
+--timedrun            run a script an time its run
 
---usekpse            use kpse as fallback (when no mkiv and cache installed, often slower)
---forcekpse          force using kpse (handy when no mkiv and cache installed but less functionality)
+--usekpse             use kpse as fallback (when no mkiv and cache installed, often slower)
+--forcekpse           force using kpse (handy when no mkiv and cache installed but less functionality)
 ]]
 
 runners.applications = {
@@ -11137,7 +11138,8 @@ function runners.find_mtx_script(filename)
     return fullname
 end
 
-function runners.execute_ctx_script(filename,arguments)
+function runners.execute_ctx_script(filename)
+    local arguments = environment.arguments_after
     local fullname = runners.find_mtx_script(filename) or ""
     -- retyr after generate but only if --autogenerate
     if fullname == "" and environment.argument("autogenerate") then -- might become the default
@@ -11337,7 +11339,7 @@ elseif environment.argument("ctxlua") or environment.argument("internal") then
     ok = runners.execute_script(filename,true)
 elseif environment.argument("script") or environment.argument("s") then
     -- run a script by loading it (using libs), pass args
-    ok = runners.execute_ctx_script(filename,after)
+    ok = runners.execute_ctx_script(filename)
 elseif environment.argument("execute") then
     -- execute script
     ok = runners.execute_script(filename)
@@ -11374,6 +11376,9 @@ elseif filename:find("^bin:") then
     ok = runners.execute_program(filename)
 else
     ok = runners.execute_script(filename)
+    if not ok then
+        ok = runners.execute_ctx_script(filename)
+    end
 end
 
 if os.platform == "unix" then
diff --git a/scripts/context/stubs/mswin/context.exe b/scripts/context/stubs/mswin/context.exe
index 8f3ad2eea..9a67fc133 100755
Binary files a/scripts/context/stubs/mswin/context.exe and b/scripts/context/stubs/mswin/context.exe differ
diff --git a/scripts/context/stubs/mswin/luatools.exe b/scripts/context/stubs/mswin/luatools.exe
index 8f3ad2eea..9a67fc133 100755
Binary files a/scripts/context/stubs/mswin/luatools.exe and b/scripts/context/stubs/mswin/luatools.exe differ
diff --git a/scripts/context/stubs/mswin/metatex.exe b/scripts/context/stubs/mswin/metatex.exe
index 8f3ad2eea..9a67fc133 100755
Binary files a/scripts/context/stubs/mswin/metatex.exe and b/scripts/context/stubs/mswin/metatex.exe differ
diff --git a/scripts/context/stubs/mswin/mtxrun.dll b/scripts/context/stubs/mswin/mtxrun.dll
index 4c4dfbf66..6af687abe 100644
Binary files a/scripts/context/stubs/mswin/mtxrun.dll and b/scripts/context/stubs/mswin/mtxrun.dll differ
diff --git a/scripts/context/stubs/mswin/mtxrun.exe b/scripts/context/stubs/mswin/mtxrun.exe
index 8f3ad2eea..9a67fc133 100755
Binary files a/scripts/context/stubs/mswin/mtxrun.exe and b/scripts/context/stubs/mswin/mtxrun.exe differ
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 8e2524147..a1fc6eaf5 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -10750,10 +10750,11 @@ messages.help = [[
 --edit                launch editor with found file
 --launch (--all)      launch files like manuals, assumes os support
 
---intern              run script using built in libraries
+--internal            run script using built in libraries (same as --ctxlua)
+--timedrun            run a script an time its run
 
---usekpse            use kpse as fallback (when no mkiv and cache installed, often slower)
---forcekpse          force using kpse (handy when no mkiv and cache installed but less functionality)
+--usekpse             use kpse as fallback (when no mkiv and cache installed, often slower)
+--forcekpse           force using kpse (handy when no mkiv and cache installed but less functionality)
 ]]
 
 runners.applications = {
@@ -11137,7 +11138,8 @@ function runners.find_mtx_script(filename)
     return fullname
 end
 
-function runners.execute_ctx_script(filename,arguments)
+function runners.execute_ctx_script(filename)
+    local arguments = environment.arguments_after
     local fullname = runners.find_mtx_script(filename) or ""
     -- retyr after generate but only if --autogenerate
     if fullname == "" and environment.argument("autogenerate") then -- might become the default
@@ -11337,7 +11339,7 @@ elseif environment.argument("ctxlua") or environment.argument("internal") then
     ok = runners.execute_script(filename,true)
 elseif environment.argument("script") or environment.argument("s") then
     -- run a script by loading it (using libs), pass args
-    ok = runners.execute_ctx_script(filename,after)
+    ok = runners.execute_ctx_script(filename)
 elseif environment.argument("execute") then
     -- execute script
     ok = runners.execute_script(filename)
@@ -11374,6 +11376,9 @@ elseif filename:find("^bin:") then
     ok = runners.execute_program(filename)
 else
     ok = runners.execute_script(filename)
+    if not ok then
+        ok = runners.execute_ctx_script(filename)
+    end
 end
 
 if os.platform == "unix" then
diff --git a/scripts/context/stubs/mswin/mtxworks.exe b/scripts/context/stubs/mswin/mtxworks.exe
index 8f3ad2eea..9a67fc133 100755
Binary files a/scripts/context/stubs/mswin/mtxworks.exe and b/scripts/context/stubs/mswin/mtxworks.exe differ
diff --git a/scripts/context/stubs/mswin/texexec.exe b/scripts/context/stubs/mswin/texexec.exe
index 8f3ad2eea..9a67fc133 100755
Binary files a/scripts/context/stubs/mswin/texexec.exe and b/scripts/context/stubs/mswin/texexec.exe differ
diff --git a/scripts/context/stubs/mswin/texmfstart.exe b/scripts/context/stubs/mswin/texmfstart.exe
index 8f3ad2eea..9a67fc133 100755
Binary files a/scripts/context/stubs/mswin/texmfstart.exe and b/scripts/context/stubs/mswin/texmfstart.exe differ
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 8e2524147..a1fc6eaf5 100755
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -10750,10 +10750,11 @@ messages.help = [[
 --edit                launch editor with found file
 --launch (--all)      launch files like manuals, assumes os support
 
---intern              run script using built in libraries
+--internal            run script using built in libraries (same as --ctxlua)
+--timedrun            run a script an time its run
 
---usekpse            use kpse as fallback (when no mkiv and cache installed, often slower)
---forcekpse          force using kpse (handy when no mkiv and cache installed but less functionality)
+--usekpse             use kpse as fallback (when no mkiv and cache installed, often slower)
+--forcekpse           force using kpse (handy when no mkiv and cache installed but less functionality)
 ]]
 
 runners.applications = {
@@ -11137,7 +11138,8 @@ function runners.find_mtx_script(filename)
     return fullname
 end
 
-function runners.execute_ctx_script(filename,arguments)
+function runners.execute_ctx_script(filename)
+    local arguments = environment.arguments_after
     local fullname = runners.find_mtx_script(filename) or ""
     -- retyr after generate but only if --autogenerate
     if fullname == "" and environment.argument("autogenerate") then -- might become the default
@@ -11337,7 +11339,7 @@ elseif environment.argument("ctxlua") or environment.argument("internal") then
     ok = runners.execute_script(filename,true)
 elseif environment.argument("script") or environment.argument("s") then
     -- run a script by loading it (using libs), pass args
-    ok = runners.execute_ctx_script(filename,after)
+    ok = runners.execute_ctx_script(filename)
 elseif environment.argument("execute") then
     -- execute script
     ok = runners.execute_script(filename)
@@ -11374,6 +11376,9 @@ elseif filename:find("^bin:") then
     ok = runners.execute_program(filename)
 else
     ok = runners.execute_script(filename)
+    if not ok then
+        ok = runners.execute_ctx_script(filename)
+    end
 end
 
 if os.platform == "unix" then
diff --git a/tex/context/base/enco-ffr.mkii b/tex/context/base/enco-ffr.mkii
index c321153e8..093cc6500 100644
--- a/tex/context/base/enco-ffr.mkii
+++ b/tex/context/base/enco-ffr.mkii
@@ -41,6 +41,10 @@
     \defineactivecharacter ? {\mathortext{?}{\directdiscretionary{?}}}
 \stoplanguagespecifics
 
+\appendtoks % maybe everywhere
+    \chardef\activecharactermode\zerocount
+\to\everyMPgraphic
+
 % maybe tricky due to possible name clashes:
 %
 % \def\ieme {\highordinalstr{e}}
diff --git a/tex/context/base/math-dim.lua b/tex/context/base/math-dim.lua
index bc3646872..b1e9635ae 100644
--- a/tex/context/base/math-dim.lua
+++ b/tex/context/base/math-dim.lua
@@ -21,9 +21,9 @@ local defaults = {
         ['default']={ "AccentBaseHeight", "x_height" },
     },
     ['fraction_del_size']={
-        ['default']={ "0", "delim2" },
-        ['cramped_display_style']={ "0", "delim1" },
-        ['display_style']={ "0", "delim1" },
+        ['default']={ "FractionDelimiterSize", "delim2" },
+        ['cramped_display_style']={ "FractionDelimiterDisplayStyleSize", "delim1" },
+        ['display_style']={ "FractionDelimiterDisplayStyleSize", "delim1" },
      },
     ['fraction_denom_down']={
         ['default']={ "FractionDenominatorShiftDown", "denom2" },
@@ -260,6 +260,9 @@ function mathematics.dimensions(dimens)
             FractionNumeratorGapMin                     = t . fraction_num_vgap     . text_style,
             FractionNumeratorShiftUp                    = t . fraction_num_up       . text_style,
             FractionRuleThickness                       = t . fraction_rule         . text_style,
+--~ not yet in my bin :
+--~             FractionDelimiterSize                       = t . fraction_del_size     . text_style,
+--~             FractionDelimiterDisplayStyleSize           = t . fraction_del_size     . display_style,
             LowerLimitBaselineDropMin                   = t . limit_below_bgap      . text_style,
             LowerLimitGapMin                            = t . limit_below_vgap      . text_style,
             OverbarExtraAscender                        = t . overbar_kern          . text_style,
diff --git a/tex/context/base/meta-ini.mkii b/tex/context/base/meta-ini.mkii
index f9d097049..e4fb2e14e 100644
--- a/tex/context/base/meta-ini.mkii
+++ b/tex/context/base/meta-ini.mkii
@@ -715,6 +715,7 @@
 \appendtoks
     \disablediscretionaries
     \disablecompoundcharacters
+    \chardef\activecharactermode\zerocount % new, experimental (if complaints than only in enco-ffr.mkii)
 \to\everyMPgraphic
 
 \appendtoks
diff --git a/tex/context/base/typo-mir.lua b/tex/context/base/typo-mir.lua
index b85a8b833..54b88dfac 100644
--- a/tex/context/base/typo-mir.lua
+++ b/tex/context/base/typo-mir.lua
@@ -156,6 +156,7 @@ function mirror.process(namespace,attribute,start) -- todo: make faster
     local lro, rlo, prevattr, inmath = false, false, 0, false
     while current do
         local id = current.id
+--~ print(id,attribute,has_attribute(current,attribute))
         if skipmath and id == mthnode then
             local subtype = current.subtype
             if subtype == 0 then
@@ -172,8 +173,7 @@ function mirror.process(namespace,attribute,start) -- todo: make faster
         else
             local attr = has_attribute(current,attribute)
             if attr and attr > 0 then
-                unset_attribute(current,attribute) -- slow, needed?
---~             set_attribute(current,attribute,0) -- might be faster
+             -- unset_attribute(current,attribute) -- slow, needed?
                 if attr == 1 then
                     -- bidi parsing mode
                 elseif attr ~= prevattr then
@@ -312,12 +312,10 @@ function mirror.process(namespace,attribute,start) -- todo: make faster
                         end
                         obsolete[#obsolete+1] = current
                     end
-                else
-                    if trace_mirroring then
-                        local char = current.char
-                        local d = directions[char]
-                        list[#list+1] = format("char %s (%s / U+%04X) of class %s (no bidi)",utfchar(char),char,char,d or "?")
-                    end
+                elseif trace_mirroring then
+                    local char = current.char
+                    local d = directions[char]
+                    list[#list+1] = format("char %s (%s / U+%04X) of class %s (no bidi)",utfchar(char),char,char,d or "?")
                 end
             elseif id == whatsit then
                 if finish then
-- 
cgit v1.2.3