From 5ab3de5b82ca897d811c6f649895cee1dd7e7e56 Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Fri, 4 Jul 2014 16:15:04 +0200 Subject: 2014-07-04 15:57:00 --- scripts/context/lua/mtxrun.lua | 76 ++++++++++++------ scripts/context/stubs/mswin/mtxrun.lua | 76 ++++++++++++------ scripts/context/stubs/unix/mtxrun | 76 ++++++++++++------ scripts/context/stubs/win64/mtxrun.lua | 76 ++++++++++++------ tex/context/base/attr-lay.mkiv | 2 + tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4427 -> 4439 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/data-tre.lua | 85 +++++++++++++++------ tex/context/base/lpdf-ren.lua | 36 +++++++-- tex/context/base/math-stc.mkvi | 6 +- tex/context/base/status-files.pdf | Bin 24927 -> 24940 bytes tex/context/base/status-lua.pdf | Bin 249534 -> 249536 bytes tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 14 files changed, 314 insertions(+), 125 deletions(-) diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 70f493525..3de087ce6 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -16101,7 +16101,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tre"] = package.loaded["data-tre"] or true --- original size: 4859, stripped down to: 3335 +-- original size: 6621, stripped down to: 4280 if not modules then modules={} end modules ['data-tre']={ version=1.001, @@ -16113,11 +16113,13 @@ if not modules then modules={} end modules ['data-tre']={ local find,gsub,lower=string.find,string.gsub,string.lower local basename,dirname,joinname=file.basename,file.dirname,file .join local globdir,isdir=dir.glob,lfs.isdir +local P,lpegmatch=lpeg.P,lpeg.match local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end) local report_trees=logs.reporter("resolvers","trees") local resolvers=resolvers local resolveprefix=resolvers.resolve local notfound=resolvers.finders.notfound +local lookup=resolvers.get_from_content local collectors={} local found={} function resolvers.finders.tree(specification) @@ -16171,34 +16173,62 @@ function resolvers.hashers.tree(specification) resolvers.generators.file(specification) end local collectors={} +local splitter=lpeg.splitat("/**/") +local stripper=lpeg.replacer { [P("/")*P("*")^1*P(-1)]="" } table.setmetatableindex(collectors,function(t,k) - local rootname=gsub(k,"[/%*]+$","") + local rootname=lpegmatch(stripper,k) local dataname=joinname(rootname,"dirlist") - local data=caches.loadcontent(dataname,"files",dataname) - local content=data and data.content - local lookup=resolvers.get_from_content + local content=caches.loadcontent(dataname,"files",dataname) if not content then content=resolvers.scanfiles(rootname) caches.savecontent(dataname,"files",content,dataname) end - local files=content.files - local v=function(filename) - local path,name=lookup(content,filename) - if not path then - return filename - elseif type(path)=="table" then - path=path[1] - end - return joinname(rootname,path,name) - end - t[k]=v - return v + t[k]=content + return content end) function resolvers.finders.dirlist(specification) - local spec=specification.filename - if spec~="" then - local path,name=dirname(spec),basename(spec) - return path and collectors[path](name) or notfound() + local filename=specification.filename + if filename~="" then + local root,rest=lpegmatch(splitter,filename) + if root and rest then + local path,name=dirname(rest),basename(rest) + if name~=rest then + local content=collectors[root] + local p,n=lookup(content,name) + if not p then + return notfound() + end + local pattern=".*/"..path.."$" + local istable=type(p)=="table" + if istable then + for i=1,#p do + local pi=p[i] + if pi==path or find(pi,pattern) then + return joinname(root,pi,n) + end + end + else + if p==path or find(p,pattern) then + return joinname(root,p,n) + end + end + local queries=specification.queries + if queries and queries.option=="fileonly" then + return joinname(root,istable and p[1] or p,n) + end + return notfound() + end + end + local path,name=dirname(filename),basename(filename) + local root=lpegmatch(stripper,path) + local content=collectors[path] + local p,n=lookup(content,name) + if not p then + return notfound() + elseif type(p)=="table" then + p=p[1] + end + return joinname(root,p,n) end return notfound() end @@ -17126,8 +17156,8 @@ end -- of closure -- used libraries : l-lua.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-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-mrg.lua util-tpl.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 : 704727 --- stripped bytes : 250243 +-- original bytes : 706489 +-- stripped bytes : 251060 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 70f493525..3de087ce6 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -16101,7 +16101,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tre"] = package.loaded["data-tre"] or true --- original size: 4859, stripped down to: 3335 +-- original size: 6621, stripped down to: 4280 if not modules then modules={} end modules ['data-tre']={ version=1.001, @@ -16113,11 +16113,13 @@ if not modules then modules={} end modules ['data-tre']={ local find,gsub,lower=string.find,string.gsub,string.lower local basename,dirname,joinname=file.basename,file.dirname,file .join local globdir,isdir=dir.glob,lfs.isdir +local P,lpegmatch=lpeg.P,lpeg.match local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end) local report_trees=logs.reporter("resolvers","trees") local resolvers=resolvers local resolveprefix=resolvers.resolve local notfound=resolvers.finders.notfound +local lookup=resolvers.get_from_content local collectors={} local found={} function resolvers.finders.tree(specification) @@ -16171,34 +16173,62 @@ function resolvers.hashers.tree(specification) resolvers.generators.file(specification) end local collectors={} +local splitter=lpeg.splitat("/**/") +local stripper=lpeg.replacer { [P("/")*P("*")^1*P(-1)]="" } table.setmetatableindex(collectors,function(t,k) - local rootname=gsub(k,"[/%*]+$","") + local rootname=lpegmatch(stripper,k) local dataname=joinname(rootname,"dirlist") - local data=caches.loadcontent(dataname,"files",dataname) - local content=data and data.content - local lookup=resolvers.get_from_content + local content=caches.loadcontent(dataname,"files",dataname) if not content then content=resolvers.scanfiles(rootname) caches.savecontent(dataname,"files",content,dataname) end - local files=content.files - local v=function(filename) - local path,name=lookup(content,filename) - if not path then - return filename - elseif type(path)=="table" then - path=path[1] - end - return joinname(rootname,path,name) - end - t[k]=v - return v + t[k]=content + return content end) function resolvers.finders.dirlist(specification) - local spec=specification.filename - if spec~="" then - local path,name=dirname(spec),basename(spec) - return path and collectors[path](name) or notfound() + local filename=specification.filename + if filename~="" then + local root,rest=lpegmatch(splitter,filename) + if root and rest then + local path,name=dirname(rest),basename(rest) + if name~=rest then + local content=collectors[root] + local p,n=lookup(content,name) + if not p then + return notfound() + end + local pattern=".*/"..path.."$" + local istable=type(p)=="table" + if istable then + for i=1,#p do + local pi=p[i] + if pi==path or find(pi,pattern) then + return joinname(root,pi,n) + end + end + else + if p==path or find(p,pattern) then + return joinname(root,p,n) + end + end + local queries=specification.queries + if queries and queries.option=="fileonly" then + return joinname(root,istable and p[1] or p,n) + end + return notfound() + end + end + local path,name=dirname(filename),basename(filename) + local root=lpegmatch(stripper,path) + local content=collectors[path] + local p,n=lookup(content,name) + if not p then + return notfound() + elseif type(p)=="table" then + p=p[1] + end + return joinname(root,p,n) end return notfound() end @@ -17126,8 +17156,8 @@ end -- of closure -- used libraries : l-lua.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-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-mrg.lua util-tpl.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 : 704727 --- stripped bytes : 250243 +-- original bytes : 706489 +-- stripped bytes : 251060 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 70f493525..3de087ce6 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -16101,7 +16101,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tre"] = package.loaded["data-tre"] or true --- original size: 4859, stripped down to: 3335 +-- original size: 6621, stripped down to: 4280 if not modules then modules={} end modules ['data-tre']={ version=1.001, @@ -16113,11 +16113,13 @@ if not modules then modules={} end modules ['data-tre']={ local find,gsub,lower=string.find,string.gsub,string.lower local basename,dirname,joinname=file.basename,file.dirname,file .join local globdir,isdir=dir.glob,lfs.isdir +local P,lpegmatch=lpeg.P,lpeg.match local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end) local report_trees=logs.reporter("resolvers","trees") local resolvers=resolvers local resolveprefix=resolvers.resolve local notfound=resolvers.finders.notfound +local lookup=resolvers.get_from_content local collectors={} local found={} function resolvers.finders.tree(specification) @@ -16171,34 +16173,62 @@ function resolvers.hashers.tree(specification) resolvers.generators.file(specification) end local collectors={} +local splitter=lpeg.splitat("/**/") +local stripper=lpeg.replacer { [P("/")*P("*")^1*P(-1)]="" } table.setmetatableindex(collectors,function(t,k) - local rootname=gsub(k,"[/%*]+$","") + local rootname=lpegmatch(stripper,k) local dataname=joinname(rootname,"dirlist") - local data=caches.loadcontent(dataname,"files",dataname) - local content=data and data.content - local lookup=resolvers.get_from_content + local content=caches.loadcontent(dataname,"files",dataname) if not content then content=resolvers.scanfiles(rootname) caches.savecontent(dataname,"files",content,dataname) end - local files=content.files - local v=function(filename) - local path,name=lookup(content,filename) - if not path then - return filename - elseif type(path)=="table" then - path=path[1] - end - return joinname(rootname,path,name) - end - t[k]=v - return v + t[k]=content + return content end) function resolvers.finders.dirlist(specification) - local spec=specification.filename - if spec~="" then - local path,name=dirname(spec),basename(spec) - return path and collectors[path](name) or notfound() + local filename=specification.filename + if filename~="" then + local root,rest=lpegmatch(splitter,filename) + if root and rest then + local path,name=dirname(rest),basename(rest) + if name~=rest then + local content=collectors[root] + local p,n=lookup(content,name) + if not p then + return notfound() + end + local pattern=".*/"..path.."$" + local istable=type(p)=="table" + if istable then + for i=1,#p do + local pi=p[i] + if pi==path or find(pi,pattern) then + return joinname(root,pi,n) + end + end + else + if p==path or find(p,pattern) then + return joinname(root,p,n) + end + end + local queries=specification.queries + if queries and queries.option=="fileonly" then + return joinname(root,istable and p[1] or p,n) + end + return notfound() + end + end + local path,name=dirname(filename),basename(filename) + local root=lpegmatch(stripper,path) + local content=collectors[path] + local p,n=lookup(content,name) + if not p then + return notfound() + elseif type(p)=="table" then + p=p[1] + end + return joinname(root,p,n) end return notfound() end @@ -17126,8 +17156,8 @@ end -- of closure -- used libraries : l-lua.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-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-mrg.lua util-tpl.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 : 704727 --- stripped bytes : 250243 +-- original bytes : 706489 +-- stripped bytes : 251060 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 70f493525..3de087ce6 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -16101,7 +16101,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tre"] = package.loaded["data-tre"] or true --- original size: 4859, stripped down to: 3335 +-- original size: 6621, stripped down to: 4280 if not modules then modules={} end modules ['data-tre']={ version=1.001, @@ -16113,11 +16113,13 @@ if not modules then modules={} end modules ['data-tre']={ local find,gsub,lower=string.find,string.gsub,string.lower local basename,dirname,joinname=file.basename,file.dirname,file .join local globdir,isdir=dir.glob,lfs.isdir +local P,lpegmatch=lpeg.P,lpeg.match local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end) local report_trees=logs.reporter("resolvers","trees") local resolvers=resolvers local resolveprefix=resolvers.resolve local notfound=resolvers.finders.notfound +local lookup=resolvers.get_from_content local collectors={} local found={} function resolvers.finders.tree(specification) @@ -16171,34 +16173,62 @@ function resolvers.hashers.tree(specification) resolvers.generators.file(specification) end local collectors={} +local splitter=lpeg.splitat("/**/") +local stripper=lpeg.replacer { [P("/")*P("*")^1*P(-1)]="" } table.setmetatableindex(collectors,function(t,k) - local rootname=gsub(k,"[/%*]+$","") + local rootname=lpegmatch(stripper,k) local dataname=joinname(rootname,"dirlist") - local data=caches.loadcontent(dataname,"files",dataname) - local content=data and data.content - local lookup=resolvers.get_from_content + local content=caches.loadcontent(dataname,"files",dataname) if not content then content=resolvers.scanfiles(rootname) caches.savecontent(dataname,"files",content,dataname) end - local files=content.files - local v=function(filename) - local path,name=lookup(content,filename) - if not path then - return filename - elseif type(path)=="table" then - path=path[1] - end - return joinname(rootname,path,name) - end - t[k]=v - return v + t[k]=content + return content end) function resolvers.finders.dirlist(specification) - local spec=specification.filename - if spec~="" then - local path,name=dirname(spec),basename(spec) - return path and collectors[path](name) or notfound() + local filename=specification.filename + if filename~="" then + local root,rest=lpegmatch(splitter,filename) + if root and rest then + local path,name=dirname(rest),basename(rest) + if name~=rest then + local content=collectors[root] + local p,n=lookup(content,name) + if not p then + return notfound() + end + local pattern=".*/"..path.."$" + local istable=type(p)=="table" + if istable then + for i=1,#p do + local pi=p[i] + if pi==path or find(pi,pattern) then + return joinname(root,pi,n) + end + end + else + if p==path or find(p,pattern) then + return joinname(root,p,n) + end + end + local queries=specification.queries + if queries and queries.option=="fileonly" then + return joinname(root,istable and p[1] or p,n) + end + return notfound() + end + end + local path,name=dirname(filename),basename(filename) + local root=lpegmatch(stripper,path) + local content=collectors[path] + local p,n=lookup(content,name) + if not p then + return notfound() + elseif type(p)=="table" then + p=p[1] + end + return joinname(root,p,n) end return notfound() end @@ -17126,8 +17156,8 @@ end -- of closure -- used libraries : l-lua.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-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-mrg.lua util-tpl.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 : 704727 --- stripped bytes : 250243 +-- original bytes : 706489 +-- stripped bytes : 251060 -- end library merge diff --git a/tex/context/base/attr-lay.mkiv b/tex/context/base/attr-lay.mkiv index 6055c2a73..8181417ab 100644 --- a/tex/context/base/attr-lay.mkiv +++ b/tex/context/base/attr-lay.mkiv @@ -33,6 +33,7 @@ \setupviewerlayer [\c!state=\v!start, \c!title=, + \c!export=\v!yes, % exportable is ugly \c!printable=\v!yes, \c!scope=\v!local, % maybe global but needs checking with layout \c!method=\v!none] @@ -43,6 +44,7 @@ title = "\viewerlayerparameter\c!title", visible = "\viewerlayerparameter\c!state", editable = "\v!yes", + export = "\viewerlayerparameter\c!export", printable = "\viewerlayerparameter\c!printable", scope = "\viewerlayerparameter\c!scope" }}% diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 0c5dbb485..22bda98b0 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2014.07.03 14:52} +\newcontextversion{2014.07.04 15:55} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index b95c4f339..bb3c1a555 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index de7086acb..f92d65902 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2014.07.03 14:52} +\edef\contextversion{2014.07.04 15:55} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/data-tre.lua b/tex/context/base/data-tre.lua index 3f11ca878..940701c3f 100644 --- a/tex/context/base/data-tre.lua +++ b/tex/context/base/data-tre.lua @@ -6,11 +6,23 @@ if not modules then modules = { } end modules ['data-tre'] = { license = "see context related readme files" } --- \input tree://oeps1/**/oeps.tex +-- tree://e:/temporary/mb-mp/**/drawing.jpg" +-- tree://e:/temporary/mb-mp/**/Drawing.jpg" +-- tree://t:./**/tufte.tex" +-- tree://t:/./**/tufte.tex" +-- tree://t:/**/tufte.tex" +-- dirlist://e:/temporary/mb-mp/**/drawing.jpg" +-- dirlist://e:/temporary/mb-mp/**/Drawing.jpg" +-- dirlist://e:/temporary/mb-mp/**/just/some/place/drawing.jpg" +-- dirlist://e:/temporary/mb-mp/**/images/drawing.jpg" +-- dirlist://e:/temporary/mb-mp/**/images/drawing.jpg?option=fileonly" +-- dirlist://///storage-2/resources/mb-mp/**/drawing.jpg" +-- dirlist://e:/**/drawing.jpg" local find, gsub, lower = string.find, string.gsub, string.lower local basename, dirname, joinname = file.basename, file.dirname, file .join local globdir, isdir = dir.glob, lfs.isdir +local P, lpegmatch = lpeg.P, lpeg.match local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end) @@ -19,6 +31,7 @@ local report_trees = logs.reporter("resolvers","trees") local resolvers = resolvers local resolveprefix = resolvers.resolve local notfound = resolvers.finders.notfound +local lookup = resolvers.get_from_content -- A tree search is rather dumb ... there is some basic caching of searched trees -- but nothing is cached over runs ... it's also a wildcard one so we cannot use @@ -87,37 +100,65 @@ end -- deal and we don't want too much overhead. local collectors = { } +local splitter = lpeg.splitat("/**/") +local stripper = lpeg.replacer { [P("/") * P("*")^1 * P(-1)] = "" } table.setmetatableindex(collectors, function(t,k) - local rootname = gsub(k,"[/%*]+$","") + local rootname = lpegmatch(stripper,k) local dataname = joinname(rootname,"dirlist") - local data = caches.loadcontent(dataname,"files",dataname) - local content = data and data.content - local lookup = resolvers.get_from_content + local content = caches.loadcontent(dataname,"files",dataname) if not content then content = resolvers.scanfiles(rootname) caches.savecontent(dataname,"files",content,dataname) end - local files = content.files - local v = function(filename) - local path, name = lookup(content,filename) - if not path then - return filename - elseif type(path) == "table" then - -- maybe a warning that the first name is taken - path = path[1] - end - return joinname(rootname,path,name) - end - t[k] = v - return v + t[k] = content + return content end) function resolvers.finders.dirlist(specification) -- can be called directly too - local spec = specification.filename - if spec ~= "" then - local path, name = dirname(spec), basename(spec) - return path and collectors[path](name) or notfound() + local filename = specification.filename + if filename ~= "" then + local root, rest = lpegmatch(splitter,filename) + if root and rest then + local path, name = dirname(rest), basename(rest) + if name ~= rest then + local content = collectors[root] + local p, n = lookup(content,name) + if not p then + return notfound() + end + local pattern = ".*/" .. path .. "$" + local istable = type(p) == "table" + if istable then + for i=1,#p do + local pi = p[i] + if pi == path or find(pi,pattern) then + return joinname(root,pi,n) + end + end + else + if p == path or find(p,pattern) then + return joinname(root,p,n) + end + end + local queries = specification.queries + if queries and queries.option == "fileonly" then + return joinname(root,istable and p[1] or p,n) + end + return notfound() + end + end + local path, name = dirname(filename), basename(filename) + local root = lpegmatch(stripper,path) + local content = collectors[path] + local p, n = lookup(content,name) + if not p then + return notfound() + elseif type(p) == "table" then + -- maybe a warning that the first name is taken + p = p[1] + end + return joinname(root,p,n) end return notfound() end diff --git a/tex/context/base/lpdf-ren.lua b/tex/context/base/lpdf-ren.lua index 37b706420..61676d5a8 100644 --- a/tex/context/base/lpdf-ren.lua +++ b/tex/context/base/lpdf-ren.lua @@ -54,12 +54,27 @@ local pdf_ocg = pdfconstant("OCG") local pdf_ocmd = pdfconstant("OCMD") local pdf_off = pdfconstant("OFF") local pdf_on = pdfconstant("ON") +local pdf_view = pdfconstant("View") +local pdf_design = pdfconstant("Design") local pdf_toggle = pdfconstant("Toggle") local pdf_setocgstate = pdfconstant("SetOCGState") local copy_node = node.copy -local lpdf_usage = pdfdictionary { Print = pdfdictionary { PrintState = pdf_off } } +local pdf_print = { + [v_yes] = pdfdictionary { PrintState = pdf_on }, + [v_no ] = pdfdictionary { PrintState = pdf_off }, +} + +local pdf_intent = { + [v_yes] = pdf_view, + [v_no] = pdf_design, +} + +local pdf_export = { + [v_yes] = pdf_on, + [v_no] = pdf_off, +} -- We can have references to layers before they are places, for instance from -- hide and vide actions. This is why we need to be able to force usage of layers @@ -99,10 +114,13 @@ local function useviewerlayer(name) -- move up so that we can use it as local local nn = pdfreserveobject() local nr = pdfreference(nn) local nd = pdfdictionary { - Type = pdf_ocg, - Name = specification.title or "unknown", - Intent = ((specification.editable ~= v_no) and pdf_design) or nil, -- disable layer hiding by user - Usage = ((specification.printable == v_no) and lpdf_usage) or nil, -- printable or not + Type = pdf_ocg, + Name = specification.title or "unknown", + Usage = { + Intent = pdf_intent[specification.editable or v_yes], -- disable layer hiding by user (useless) + Print = pdf_print [specification.printable or v_yes], -- printable or not + Export = pdf_export[specification.export or v_yes], -- export or not + }, } cache[#cache+1] = { nn, nd } pdfln[tag] = nr -- was n @@ -165,6 +183,14 @@ local function flushtextlayers() ON = videlayers, OFF = hidelayers, BaseState = pdf_on, + +AS = pdfarray { + pdfdictionary { + Category = pdfarray { pdfconstant("Print") }, + Event = pdfconstant("Print"), + OCGs = (viewerlayers.hasorder and sortedlayers) or nil, + } +}, }, } addtocatalog("OCProperties",d) diff --git a/tex/context/base/math-stc.mkvi b/tex/context/base/math-stc.mkvi index 76a07db5c..140d0244b 100644 --- a/tex/context/base/math-stc.mkvi +++ b/tex/context/base/math-stc.mkvi @@ -376,7 +376,7 @@ \egroup % \ifdim\htdp\scratchboxone>\zeropoint - \scratchoffset\dimexpr\scratchvoffset + \scratchoffset\scratchvoffset \kern-\scratchwidth \math_stackers_top\bgroup \raise\dimexpr\dp\scratchboxone+\scratchheight+\scratchoffset+\scratchtopoffset\relax @@ -385,7 +385,7 @@ \fi % \ifdim\htdp\scratchboxtwo>\zeropoint - \scratchoffset\dimexpr\scratchvoffset + \scratchoffset\scratchvoffset \kern-\scratchwidth \math_stackers_bottom\bgroup \lower\dimexpr\ht\scratchboxtwo+\scratchdepth+\scratchoffset+\scratchbottomoffset\relax @@ -467,7 +467,7 @@ % \math_stackers_check_unicode{#codepoint}% % - \ifx\currentmathtext\empty + \ifx\math_stackers_middle\empty \setbox\scratchboxthree\emptyhbox \else \setmathtextbox\scratchboxthree\hbox{\math_stackers_middletext}% diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 95da7c75e..5bfd7eade 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 b095cf6bc..1da58153a 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index a62958c1c..52a65ea57 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 : 07/03/14 14:52:08 +-- merge date : 07/04/14 15:55:31 do -- begin closure to overcome local limits and interference -- cgit v1.2.3