summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtx-base.lua2
-rw-r--r--scripts/context/lua/mtxrun.lua20
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua20
-rwxr-xr-xscripts/context/stubs/unix/mtxrun20
4 files changed, 40 insertions, 22 deletions
diff --git a/scripts/context/lua/mtx-base.lua b/scripts/context/lua/mtx-base.lua
index 443f653f0..67bde5b79 100644
--- a/scripts/context/lua/mtx-base.lua
+++ b/scripts/context/lua/mtx-base.lua
@@ -130,7 +130,7 @@ elseif environment.arguments["configurations"] or environment.arguments["show-co
resolvers.listers.configurations()
elseif environment.arguments["help"] or (environment.files[1]=='help') or (#environment.files==0) then
logs.help(messages.help)
-elseif environment.files[1]=='texmfcnf.lua' then
+elseif environment.files[1] == 'texmfcnf.lua' then
resolvers.load("nofiles")
resolvers.listers.configurations()
else
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index f792cd942..246d08103 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -709,20 +709,22 @@ function table.imerged(...)
return tmp
end
-local function fastcopy(old) -- fast one
+local function fastcopy(old,metatabletoo) -- fast one
if old then
local new = { }
for k,v in next, old do
if type(v) == "table" then
- new[k] = fastcopy(v) -- was just table.copy
+ new[k] = fastcopy(v,metatabletoo) -- was just table.copy
else
new[k] = v
end
end
- -- optional second arg
- local mt = getmetatable(old)
- if mt then
- setmetatable(new,mt)
+ if metatabletoo then
+ -- optional second arg
+ local mt = getmetatable(old)
+ if mt then
+ setmetatable(new,mt)
+ end
end
return new
else
@@ -730,6 +732,8 @@ local function fastcopy(old) -- fast one
end
end
+-- todo : copy without metatable
+
local function copy(t, tables) -- taken from lua wiki, slightly adapted
tables = tables or { }
local tcopy = {}
@@ -1146,6 +1150,7 @@ function table.tofile(filename,root,name,reduce,noquotes,hexify)
serialize(root,name,flush,reduce,noquotes,hexify)
end
f:close()
+ io.flush()
end
end
@@ -1381,6 +1386,7 @@ function io.savedata(filename,data,joiner)
f:write(data or "")
end
f:close()
+ io.flush()
return true
else
return false
@@ -9406,7 +9412,7 @@ function resolvers.variableofformat(str)
return formats[str] or formats[alternatives[str]] or ''
end
-function resolvers.vsriableofformatorsuffix(str)
+function resolvers.variableofformatorsuffix(str)
local v = formats[str]
if v then
return v
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index f792cd942..246d08103 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -709,20 +709,22 @@ function table.imerged(...)
return tmp
end
-local function fastcopy(old) -- fast one
+local function fastcopy(old,metatabletoo) -- fast one
if old then
local new = { }
for k,v in next, old do
if type(v) == "table" then
- new[k] = fastcopy(v) -- was just table.copy
+ new[k] = fastcopy(v,metatabletoo) -- was just table.copy
else
new[k] = v
end
end
- -- optional second arg
- local mt = getmetatable(old)
- if mt then
- setmetatable(new,mt)
+ if metatabletoo then
+ -- optional second arg
+ local mt = getmetatable(old)
+ if mt then
+ setmetatable(new,mt)
+ end
end
return new
else
@@ -730,6 +732,8 @@ local function fastcopy(old) -- fast one
end
end
+-- todo : copy without metatable
+
local function copy(t, tables) -- taken from lua wiki, slightly adapted
tables = tables or { }
local tcopy = {}
@@ -1146,6 +1150,7 @@ function table.tofile(filename,root,name,reduce,noquotes,hexify)
serialize(root,name,flush,reduce,noquotes,hexify)
end
f:close()
+ io.flush()
end
end
@@ -1381,6 +1386,7 @@ function io.savedata(filename,data,joiner)
f:write(data or "")
end
f:close()
+ io.flush()
return true
else
return false
@@ -9406,7 +9412,7 @@ function resolvers.variableofformat(str)
return formats[str] or formats[alternatives[str]] or ''
end
-function resolvers.vsriableofformatorsuffix(str)
+function resolvers.variableofformatorsuffix(str)
local v = formats[str]
if v then
return v
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index f792cd942..246d08103 100755
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -709,20 +709,22 @@ function table.imerged(...)
return tmp
end
-local function fastcopy(old) -- fast one
+local function fastcopy(old,metatabletoo) -- fast one
if old then
local new = { }
for k,v in next, old do
if type(v) == "table" then
- new[k] = fastcopy(v) -- was just table.copy
+ new[k] = fastcopy(v,metatabletoo) -- was just table.copy
else
new[k] = v
end
end
- -- optional second arg
- local mt = getmetatable(old)
- if mt then
- setmetatable(new,mt)
+ if metatabletoo then
+ -- optional second arg
+ local mt = getmetatable(old)
+ if mt then
+ setmetatable(new,mt)
+ end
end
return new
else
@@ -730,6 +732,8 @@ local function fastcopy(old) -- fast one
end
end
+-- todo : copy without metatable
+
local function copy(t, tables) -- taken from lua wiki, slightly adapted
tables = tables or { }
local tcopy = {}
@@ -1146,6 +1150,7 @@ function table.tofile(filename,root,name,reduce,noquotes,hexify)
serialize(root,name,flush,reduce,noquotes,hexify)
end
f:close()
+ io.flush()
end
end
@@ -1381,6 +1386,7 @@ function io.savedata(filename,data,joiner)
f:write(data or "")
end
f:close()
+ io.flush()
return true
else
return false
@@ -9406,7 +9412,7 @@ function resolvers.variableofformat(str)
return formats[str] or formats[alternatives[str]] or ''
end
-function resolvers.vsriableofformatorsuffix(str)
+function resolvers.variableofformatorsuffix(str)
local v = formats[str]
if v then
return v