summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtx-interface.lua11
-rw-r--r--scripts/context/lua/mtx-plain.lua3
-rw-r--r--scripts/context/lua/mtx-synctex.lua8
-rw-r--r--scripts/context/lua/mtxrun.lua46
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua46
-rw-r--r--scripts/context/stubs/unix/mtxrun46
-rw-r--r--scripts/context/stubs/win64/mtxrun.lua46
7 files changed, 140 insertions, 66 deletions
diff --git a/scripts/context/lua/mtx-interface.lua b/scripts/context/lua/mtx-interface.lua
index 50743ae87..7ffdd924e 100644
--- a/scripts/context/lua/mtx-interface.lua
+++ b/scripts/context/lua/mtx-interface.lua
@@ -346,11 +346,14 @@ function scripts.interface.editor(editor,split,forcedinterfaces)
done = false
break
end
- elseif e.tg == "instance" then
- done[i] = name
else
- done = false
- break
+ local tg = e.tg
+ if tg == "instance" or tg == "instance:assignment" or tg == "instance:ownnumber" then
+ done[i] = name
+ else
+ done = false
+ break
+ end
end
end
if done then
diff --git a/scripts/context/lua/mtx-plain.lua b/scripts/context/lua/mtx-plain.lua
index 43ced20ef..72cc48f92 100644
--- a/scripts/context/lua/mtx-plain.lua
+++ b/scripts/context/lua/mtx-plain.lua
@@ -49,7 +49,8 @@ scripts = scripts or { }
scripts.plain = scripts.plain or { }
local passed_options = table.tohash {
- "utc"
+ "utc",
+ "synctex",
}
local function execute(...)
diff --git a/scripts/context/lua/mtx-synctex.lua b/scripts/context/lua/mtx-synctex.lua
index 30f3e7d51..3c4f6ee71 100644
--- a/scripts/context/lua/mtx-synctex.lua
+++ b/scripts/context/lua/mtx-synctex.lua
@@ -28,6 +28,7 @@ local helpinfo = [[
<flag name="edit"><short>open file at line: --line=.. --editor=.. sourcefile</short></flag>
<flag name="list"><short>show blob: synctexfile</short></flag>
<flag name="goto"><short>open file at position: --page=.. --x=.. --y=.. --editor=.. synctexfile</short></flag>
+ <flag name="report"><short>show file and line: --page=.. --x=.. --y=.. --console synctexfile</short></flag>
</subcategory>
</category>
</flags>
@@ -43,6 +44,9 @@ local application = logs.application {
local report = application.report
local editors = {
+ console = function(specification)
+ print(string.formatters["%q %i"](specification.filename,specification.linenumber or 1))
+ end,
scite = sandbox.registerrunner {
name = "scite",
program = {
@@ -203,7 +207,7 @@ local function showlocation(filename)
local ury = factor * ( y + tonumber(h) )
f = files[f]
if f then
- report(" [% 4i % 4i % 4i % 4i] : % 5i : %s",llx,lly,urx,ury,l,f)
+ report(" [% 4r % 4r % 4r % 4r] : % 5i : %s",llx,lly,urx,ury,l,f)
end
end
end
@@ -245,6 +249,8 @@ if argument("edit") then
editfile(filename,argument("line"),argument("editor"))
elseif argument("goto") then
gotolocation(filename,argument("page"),argument("x"),argument("y"),argument("editor"))
+elseif argument("report") then
+ gotolocation(filename,argument("page"),argument("x"),argument("y"),"console")
elseif argument("list") then
showlocation(filename)
elseif argument("exporthelp") then
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index a92192a2a..656f4493f 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -19897,7 +19897,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-sch"] = package.loaded["data-sch"] or true
--- original size: 6753, stripped down to: 5512
+-- original size: 6753, stripped down to: 5511
if not modules then modules={} end modules ['data-sch']={
version=1.001,
@@ -19953,7 +19953,7 @@ local runner=sandbox.registerrunner {
name="curl resolver",
method="execute",
program="curl",
- template="--silent -- insecure --create-dirs --output %cachename% %original%",
+ template="--silent --insecure --create-dirs --output %cachename% %original%",
checkers={
cachename="cache",
original="url",
@@ -20380,7 +20380,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-lib"] = package.loaded["util-lib"] or true
--- original size: 14415, stripped down to: 7927
+-- original size: 14943, stripped down to: 8305
if not modules then modules={} end modules ['util-lib']={
version=1.001,
@@ -20614,21 +20614,37 @@ if FFISUPPORTED and ffi and ffi.load then
local trace_ffilib=false
local savedffiload=ffi.load
trackers.register("resolvers.ffilib",function(v) trace_ffilib=v end)
+ local loaded={}
local function locateindeed(name)
- local message,library=pcall(savedffiload,removesuffix(name))
- if type(message)=="userdata" then
- return message
- elseif type(library)=="userdata" then
- return library
- else
- return false
+ name=removesuffix(name)
+ local l=loaded[name]
+ if l==nil then
+ local message,library=pcall(savedffiload,name)
+ if type(message)=="userdata" then
+ l=message
+ elseif type(library)=="userdata" then
+ l=library
+ else
+ l=false
+ end
+ loaded[name]=l
+ elseif trace_ffilib then
+ report_ffilib("reusing already loaded %a",name)
end
+ return l
end
- function ffilib(required,version)
- if version=="system" then
+ function ffilib(name,version)
+ name=removesuffix(name)
+ local l=loaded[name]
+ if l~=nil then
+ if trace_ffilib then
+ report_ffilib("reusing already loaded %a",name)
+ end
+ return l
+ elseif version=="system" then
return locateindeed(name)
else
- return locate(required,version,trace_ffilib,report_ffilib,locateindeed)
+ return locate(name,version,trace_ffilib,report_ffilib,locateindeed)
end
end
function ffi.load(name)
@@ -20989,8 +21005,8 @@ end -- of closure
-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 866119
--- stripped bytes : 315183
+-- original bytes : 866647
+-- stripped bytes : 315334
-- end library merge
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index a92192a2a..656f4493f 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -19897,7 +19897,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-sch"] = package.loaded["data-sch"] or true
--- original size: 6753, stripped down to: 5512
+-- original size: 6753, stripped down to: 5511
if not modules then modules={} end modules ['data-sch']={
version=1.001,
@@ -19953,7 +19953,7 @@ local runner=sandbox.registerrunner {
name="curl resolver",
method="execute",
program="curl",
- template="--silent -- insecure --create-dirs --output %cachename% %original%",
+ template="--silent --insecure --create-dirs --output %cachename% %original%",
checkers={
cachename="cache",
original="url",
@@ -20380,7 +20380,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-lib"] = package.loaded["util-lib"] or true
--- original size: 14415, stripped down to: 7927
+-- original size: 14943, stripped down to: 8305
if not modules then modules={} end modules ['util-lib']={
version=1.001,
@@ -20614,21 +20614,37 @@ if FFISUPPORTED and ffi and ffi.load then
local trace_ffilib=false
local savedffiload=ffi.load
trackers.register("resolvers.ffilib",function(v) trace_ffilib=v end)
+ local loaded={}
local function locateindeed(name)
- local message,library=pcall(savedffiload,removesuffix(name))
- if type(message)=="userdata" then
- return message
- elseif type(library)=="userdata" then
- return library
- else
- return false
+ name=removesuffix(name)
+ local l=loaded[name]
+ if l==nil then
+ local message,library=pcall(savedffiload,name)
+ if type(message)=="userdata" then
+ l=message
+ elseif type(library)=="userdata" then
+ l=library
+ else
+ l=false
+ end
+ loaded[name]=l
+ elseif trace_ffilib then
+ report_ffilib("reusing already loaded %a",name)
end
+ return l
end
- function ffilib(required,version)
- if version=="system" then
+ function ffilib(name,version)
+ name=removesuffix(name)
+ local l=loaded[name]
+ if l~=nil then
+ if trace_ffilib then
+ report_ffilib("reusing already loaded %a",name)
+ end
+ return l
+ elseif version=="system" then
return locateindeed(name)
else
- return locate(required,version,trace_ffilib,report_ffilib,locateindeed)
+ return locate(name,version,trace_ffilib,report_ffilib,locateindeed)
end
end
function ffi.load(name)
@@ -20989,8 +21005,8 @@ end -- of closure
-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 866119
--- stripped bytes : 315183
+-- original bytes : 866647
+-- stripped bytes : 315334
-- end library merge
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index a92192a2a..656f4493f 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -19897,7 +19897,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-sch"] = package.loaded["data-sch"] or true
--- original size: 6753, stripped down to: 5512
+-- original size: 6753, stripped down to: 5511
if not modules then modules={} end modules ['data-sch']={
version=1.001,
@@ -19953,7 +19953,7 @@ local runner=sandbox.registerrunner {
name="curl resolver",
method="execute",
program="curl",
- template="--silent -- insecure --create-dirs --output %cachename% %original%",
+ template="--silent --insecure --create-dirs --output %cachename% %original%",
checkers={
cachename="cache",
original="url",
@@ -20380,7 +20380,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-lib"] = package.loaded["util-lib"] or true
--- original size: 14415, stripped down to: 7927
+-- original size: 14943, stripped down to: 8305
if not modules then modules={} end modules ['util-lib']={
version=1.001,
@@ -20614,21 +20614,37 @@ if FFISUPPORTED and ffi and ffi.load then
local trace_ffilib=false
local savedffiload=ffi.load
trackers.register("resolvers.ffilib",function(v) trace_ffilib=v end)
+ local loaded={}
local function locateindeed(name)
- local message,library=pcall(savedffiload,removesuffix(name))
- if type(message)=="userdata" then
- return message
- elseif type(library)=="userdata" then
- return library
- else
- return false
+ name=removesuffix(name)
+ local l=loaded[name]
+ if l==nil then
+ local message,library=pcall(savedffiload,name)
+ if type(message)=="userdata" then
+ l=message
+ elseif type(library)=="userdata" then
+ l=library
+ else
+ l=false
+ end
+ loaded[name]=l
+ elseif trace_ffilib then
+ report_ffilib("reusing already loaded %a",name)
end
+ return l
end
- function ffilib(required,version)
- if version=="system" then
+ function ffilib(name,version)
+ name=removesuffix(name)
+ local l=loaded[name]
+ if l~=nil then
+ if trace_ffilib then
+ report_ffilib("reusing already loaded %a",name)
+ end
+ return l
+ elseif version=="system" then
return locateindeed(name)
else
- return locate(required,version,trace_ffilib,report_ffilib,locateindeed)
+ return locate(name,version,trace_ffilib,report_ffilib,locateindeed)
end
end
function ffi.load(name)
@@ -20989,8 +21005,8 @@ end -- of closure
-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 866119
--- stripped bytes : 315183
+-- original bytes : 866647
+-- stripped bytes : 315334
-- end library merge
diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua
index a92192a2a..656f4493f 100644
--- a/scripts/context/stubs/win64/mtxrun.lua
+++ b/scripts/context/stubs/win64/mtxrun.lua
@@ -19897,7 +19897,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-sch"] = package.loaded["data-sch"] or true
--- original size: 6753, stripped down to: 5512
+-- original size: 6753, stripped down to: 5511
if not modules then modules={} end modules ['data-sch']={
version=1.001,
@@ -19953,7 +19953,7 @@ local runner=sandbox.registerrunner {
name="curl resolver",
method="execute",
program="curl",
- template="--silent -- insecure --create-dirs --output %cachename% %original%",
+ template="--silent --insecure --create-dirs --output %cachename% %original%",
checkers={
cachename="cache",
original="url",
@@ -20380,7 +20380,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-lib"] = package.loaded["util-lib"] or true
--- original size: 14415, stripped down to: 7927
+-- original size: 14943, stripped down to: 8305
if not modules then modules={} end modules ['util-lib']={
version=1.001,
@@ -20614,21 +20614,37 @@ if FFISUPPORTED and ffi and ffi.load then
local trace_ffilib=false
local savedffiload=ffi.load
trackers.register("resolvers.ffilib",function(v) trace_ffilib=v end)
+ local loaded={}
local function locateindeed(name)
- local message,library=pcall(savedffiload,removesuffix(name))
- if type(message)=="userdata" then
- return message
- elseif type(library)=="userdata" then
- return library
- else
- return false
+ name=removesuffix(name)
+ local l=loaded[name]
+ if l==nil then
+ local message,library=pcall(savedffiload,name)
+ if type(message)=="userdata" then
+ l=message
+ elseif type(library)=="userdata" then
+ l=library
+ else
+ l=false
+ end
+ loaded[name]=l
+ elseif trace_ffilib then
+ report_ffilib("reusing already loaded %a",name)
end
+ return l
end
- function ffilib(required,version)
- if version=="system" then
+ function ffilib(name,version)
+ name=removesuffix(name)
+ local l=loaded[name]
+ if l~=nil then
+ if trace_ffilib then
+ report_ffilib("reusing already loaded %a",name)
+ end
+ return l
+ elseif version=="system" then
return locateindeed(name)
else
- return locate(required,version,trace_ffilib,report_ffilib,locateindeed)
+ return locate(name,version,trace_ffilib,report_ffilib,locateindeed)
end
end
function ffi.load(name)
@@ -20989,8 +21005,8 @@ end -- of closure
-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 866119
--- stripped bytes : 315183
+-- original bytes : 866647
+-- stripped bytes : 315334
-- end library merge