diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua | 53 |
1 files changed, 40 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua index dac0ab441d0..a7d1a6bb5a6 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua @@ -296,7 +296,8 @@ do local checksum = nil local username = file.addsuffix(file.robustname(formatters["%s-btx-%s"](prefix,name)),"lua") if userdata and next(userdata) then - if job.passes.first then + if environment.currentrun == 1 then + -- if job.passes.first then local newdata = serialize(userdata) checksum = md5.HEX(newdata) io.savedata(username,newdata) @@ -1803,10 +1804,14 @@ do -- todo: names = { "btx" } + local function collectresult(rendering) + return structures.lists.filter(rendering.specifications) or { } + end + methods[v_force] = function (dataset,rendering,keyword) -- only for checking, can have duplicates, todo: collapse page numbers, although -- we then also needs deferred writes - local result = structures.lists.filter(rendering.specifications) or { } + local result = collectresult(rendering) local list = rendering.list local current = datasets[dataset] local luadata = current.luadata @@ -1831,7 +1836,7 @@ do -- global : if tag and not alldone[tag] and done[tag] ~= section then ... methods[v_local] = function(dataset,rendering,keyword) - local result = structures.lists.filter(rendering.specifications) or { } + local result = collectresult(rendering) local section = sections.currentid() local list = rendering.list local repeated = rendering.repeated == v_yes @@ -1903,7 +1908,7 @@ do if not dataset then return end - local rendering = renderings[dataset] + local rendering = renderings[dataset] if not rendering then return end @@ -1919,6 +1924,7 @@ do rendering.repeated = specification.repeated or v_no rendering.group = specification.group or "" rendering.specifications = specification + rendering.collected = false local filtermethod = methods[method] if not filtermethod then report_list("invalid method %a",method or "") @@ -1932,6 +1938,16 @@ do else keyword = nil end + local filename = specification.filename + if filename and filename ~= "" then + local utilitydata = job.loadother(filename) + local lists = utilitydata and utilitydata.structures.lists + if lists then + rendering.collected = lists.collected + else + return + end + end filtermethod(dataset,rendering,keyword) local list = rendering.list if list and filter ~= "" then @@ -2094,15 +2110,20 @@ do flush() end local nofranges = #ranges +local interactive = not rendering.collected for i=1,nofranges do local r = ranges[i] ctx_btxsetconcat(concatstate(i,nofranges)) local first = r[1] local last = r[2] +if interactive then ctx_btxsetfirstinternal(first[2].internal) +end ctx_btxsetfirstpage(first[1]) if last then +if interactive then ctx_btxsetlastinternal(last[2].internal) +end ctx_btxsetlastpage(last[1]) end if trace_details then @@ -2261,14 +2282,16 @@ do local list = rendering.list local li = list[i] if li then - local data = datasets[dataset] - local luadata = data.luadata - local details = data.details - local tag = li[1] - local listindex = li[2] - local n = li[3] - local entry = luadata[tag] - local detail = details[tag] + local data = datasets[dataset] + local luadata = data.luadata + local details = data.details + local tag = li[1] + local listindex = li[2] + local n = li[3] + local entry = luadata[tag] + local detail = details[tag] + -- + local interactive = not rendering.collected -- ctx_btxstartlistentry() ctx_btxsetcurrentlistentry(i) -- redundant @@ -2282,6 +2305,7 @@ do ctx_btxsettag(tag) ctx_btxsetnumber(n) -- +if interactive then local citation = citetolist[n] if citation then local references = citation.references @@ -2291,6 +2315,7 @@ do ctx_btxsetinternal(internal) end end +end end -- if language then @@ -2384,6 +2409,7 @@ do { "ignored" }, { "group" }, { "filter" }, + { "filename" }, } } } @@ -2805,6 +2831,7 @@ do -- we refer to a previous list entry bl = entry.internal end + -- no check for external (yet) ctx_btxsetinternal(bl and bl > 0 and bl or "") end local language = entry.language @@ -3255,7 +3282,7 @@ do ctx_btxsettag(tag) ctx_btxsetbacklink(currentcitation) local bl = listtocite[currentcitation] - ctx_btxsetinternal(bl and bl.references.internal or "") +-- ctx_btxsetinternal(bl and bl.references.internal or "") if first then ctx_btxsetfirst(first[key] or "") -- f_missing(first.tag)) local suffix = entry.suffix |