summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/strc-lst.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl/strc-lst.lmt')
-rw-r--r--tex/context/base/mkxl/strc-lst.lmt62
1 files changed, 37 insertions, 25 deletions
diff --git a/tex/context/base/mkxl/strc-lst.lmt b/tex/context/base/mkxl/strc-lst.lmt
index d54129f29..312a815cd 100644
--- a/tex/context/base/mkxl/strc-lst.lmt
+++ b/tex/context/base/mkxl/strc-lst.lmt
@@ -37,7 +37,8 @@ local conditionals = tex.conditionals
local ctx_latelua = context.latelua
-local cheat = true
+----- cheat = true -- fragile when we have a multi-component document with cross references
+local cheat = false -- so this will become a directive or maybe even just an experiment
local structures = structures
local lists = structures.lists
@@ -259,27 +260,34 @@ function lists.addto(t) -- maybe more more here (saves parsing at the tex end)
numberdata.numbers = cached[groupindex].numberdata.numbers
end
end
- local setcomponent = references.setcomponent
- if setcomponent then
- setcomponent(t) -- can be inlined
- end
+ --
+-- local setcomponent = references.setcomponent
+-- if setcomponent then
+-- setcomponent(t) -- can be inlined, will be replaced by setstructure below
+-- end
+ --
local r = t.references
- if r and not r.section then
- r.section = structures.sections.currentid()
- end
- local b = r and t.block
- if r and not b then
- local s = r.section
- if s then
- s = structures.sections.tobesaved[s]
- r.block = s and s.block or nil
- end
- end
local i = r and r.internal or 0 -- brrr
- if r and kind and name then
- local tag = tags.getid(kind,name)
- if tag and tag ~= "?" then
- r.tag = tag -- todo: use internal ... is unique enough
+ if r then
+ if not r.section then
+ r.section = structures.sections.currentid()
+ end
+ if not r.structure then
+ r.structure = resolvers.jobs.currentstructure()
+ end
+ local b = r and t.block
+ if not b then
+ local s = r.section
+ if s then
+ s = structures.sections.tobesaved[s]
+ r.block = s and s.block or nil
+ end
+ end
+ if kind and name then
+ local tag = tags.getid(kind,name)
+ if tag and tag ~= "?" then
+ r.tag = tag -- todo: use internal ... is unique enough
+ end
end
end
local p = pushed[i]
@@ -597,7 +605,7 @@ filters[v_intro] = function(specification)
return result
end
-filters[v_reference] = function(specification)
+filters[v_reference] = function(specification) -- this will go away
local collected = specification.collected
local result = { }
local nofresult = 0
@@ -954,7 +962,6 @@ filters[v_default] = function(specification) -- is named
for i=1,#collected do
local v = collected[i]
local r = v.references
--- inspect(v)
if r and (not block or not r.block or pblock == r.block) then
local sectionnumber = sections[r.section]
if sectionnumber then
@@ -1016,10 +1023,9 @@ function lists.process(specification)
local references = listentry.references
local special = specials and numberdata and specials[zerostrippedconcat(numberdata.numbers,".")] or ""
local view = usedviews[i]
- -- if cheat and references then
- -- -- HH: I still need to test this patch:
+-- if cheat and references and cheats[view] then
if cheat and references and view and cheats[view] then
- -- this permits runs=2 with interactivity
+ -- this permits runs=2 with interactivity
local internal = references.internal
usedinternals[internal] = true
usedviews [internal] = references.view
@@ -1591,6 +1597,12 @@ function lists.integrate(utilitydata)
-- references.internal = nil
-- references.realpage = nil
-- references.section = nil
+ if references.view then
+ references.view = nil
+ end
+ if references.used then
+ references.used = nil
+ end
if references.x then
references.x = nil
end