summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2009-12-03 00:41:00 +0100
committerHans Hagen <pragma@wxs.nl>2009-12-03 00:41:00 +0100
commita88d77afdd9ea519815a25698e446908aec42ff9 (patch)
tree8a080dc076102ae1eb7841a28583f1b226b60243 /scripts
parent56ec51208255d316952705edd62cd88f8d90bf2c (diff)
downloadcontext-a88d77afdd9ea519815a25698e446908aec42ff9.tar.gz
beta 2009.12.03 00:41
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtx-context.lua17
-rw-r--r--scripts/context/lua/mtxrun.lua15
-rwxr-xr-xscripts/context/stubs/mswin/context.exebin5631 -> 5633 bytes
-rwxr-xr-xscripts/context/stubs/mswin/luatools.exebin5631 -> 5633 bytes
-rwxr-xr-xscripts/context/stubs/mswin/metatex.exebin5631 -> 5633 bytes
-rw-r--r--scripts/context/stubs/mswin/mtxrun.dllbin7679 -> 7680 bytes
-rwxr-xr-xscripts/context/stubs/mswin/mtxrun.exebin5631 -> 5633 bytes
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua15
-rwxr-xr-xscripts/context/stubs/mswin/mtxworks.exebin5631 -> 5633 bytes
-rwxr-xr-xscripts/context/stubs/mswin/texexec.exebin5631 -> 5633 bytes
-rwxr-xr-xscripts/context/stubs/mswin/texmfstart.exebin5631 -> 5633 bytes
-rwxr-xr-xscripts/context/stubs/unix/mtxrun15
12 files changed, 42 insertions, 20 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
--- a/scripts/context/stubs/mswin/context.exe
+++ b/scripts/context/stubs/mswin/context.exe
Binary files differ
diff --git a/scripts/context/stubs/mswin/luatools.exe b/scripts/context/stubs/mswin/luatools.exe
index 8f3ad2eea..9a67fc133 100755
--- a/scripts/context/stubs/mswin/luatools.exe
+++ b/scripts/context/stubs/mswin/luatools.exe
Binary files differ
diff --git a/scripts/context/stubs/mswin/metatex.exe b/scripts/context/stubs/mswin/metatex.exe
index 8f3ad2eea..9a67fc133 100755
--- a/scripts/context/stubs/mswin/metatex.exe
+++ b/scripts/context/stubs/mswin/metatex.exe
Binary files differ
diff --git a/scripts/context/stubs/mswin/mtxrun.dll b/scripts/context/stubs/mswin/mtxrun.dll
index 4c4dfbf66..6af687abe 100644
--- a/scripts/context/stubs/mswin/mtxrun.dll
+++ b/scripts/context/stubs/mswin/mtxrun.dll
Binary files differ
diff --git a/scripts/context/stubs/mswin/mtxrun.exe b/scripts/context/stubs/mswin/mtxrun.exe
index 8f3ad2eea..9a67fc133 100755
--- a/scripts/context/stubs/mswin/mtxrun.exe
+++ b/scripts/context/stubs/mswin/mtxrun.exe
Binary files 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
--- a/scripts/context/stubs/mswin/mtxworks.exe
+++ b/scripts/context/stubs/mswin/mtxworks.exe
Binary files differ
diff --git a/scripts/context/stubs/mswin/texexec.exe b/scripts/context/stubs/mswin/texexec.exe
index 8f3ad2eea..9a67fc133 100755
--- a/scripts/context/stubs/mswin/texexec.exe
+++ b/scripts/context/stubs/mswin/texexec.exe
Binary files differ
diff --git a/scripts/context/stubs/mswin/texmfstart.exe b/scripts/context/stubs/mswin/texmfstart.exe
index 8f3ad2eea..9a67fc133 100755
--- a/scripts/context/stubs/mswin/texmfstart.exe
+++ b/scripts/context/stubs/mswin/texmfstart.exe
Binary files 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