diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-03-04 00:15:09 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-03-04 00:15:09 +0100 |
commit | 60687b77ba7082f7c554c4163c5cc31df97ea243 (patch) | |
tree | cdd467755084b1d99551f67ec1cb2f8e975be654 /tex/context/base/mkiv/strc-ref.lua | |
parent | 62676780b4363d25d7a247f39484b1e4a34ef7b7 (diff) | |
download | context-60687b77ba7082f7c554c4163c5cc31df97ea243.tar.gz |
2016-03-03 23:33:00
Diffstat (limited to 'tex/context/base/mkiv/strc-ref.lua')
-rw-r--r-- | tex/context/base/mkiv/strc-ref.lua | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/tex/context/base/mkiv/strc-ref.lua b/tex/context/base/mkiv/strc-ref.lua index b42727bce..c3b852e89 100644 --- a/tex/context/base/mkiv/strc-ref.lua +++ b/tex/context/base/mkiv/strc-ref.lua @@ -1905,7 +1905,8 @@ directives.register("references.linkmethod", function(v) -- page auto references.setinnermethod(v) end) --- this is inconsistent +-- we can call setinternalreference with an already known internal or with +-- a reference/prefix specification local destinationattributes = { } @@ -1915,6 +1916,7 @@ local function setinternalreference(specification) if innermethod == v_auto or innermethod == v_name then local t, tn = { }, 0 -- maybe add to current (now only used for tracing) local reference = specification.reference + local view = specification.view if reference then local prefix = specification.prefix if prefix and prefix ~= "" then @@ -1934,13 +1936,20 @@ local function setinternalreference(specification) end -- ugly .. later we decide to ignore it when we have a real one -- but for testing we might want to see them all - - if internal and innermethod ~= v_name then - -- we dont' want too many #1 #2 #3 etc - tn = tn + 1 - t[tn] = internal -- when number it's internal + if internal then + if innermethod ~= v_name then -- so page and auto + -- we don't want too many #1 #2 #3 etc + tn = tn + 1 + t[tn] = internal -- when number it's internal + end + if not view then + local i = references.internals[internal] + if i then + view = i.references.view + end + end end - destination = references.mark(t,nil,nil,specification.view) -- returns an attribute + destination = references.mark(t,nil,nil,view) -- returns an attribute end if internal then -- new destinationattributes[internal] = destination @@ -2017,7 +2026,7 @@ function references.setandgetattribute(data) -- maybe do internal automatically end implement { - name = "setreferenceattribute", + name = "setdestinationattribute", actions = references.setandgetattribute, arguments = { { @@ -2581,14 +2590,16 @@ end runners["special operation"] = runners["special"] runners["special operation with arguments"] = runners["special"] --- These are the testspecials not the real ones. They are used to --- check the validity. - function specials.internal(var,actions) local v = internals[tonumber(var.operation)] - local r = v and v.references.realpage + local r = v and v.references if r then - actions.realpage = r + local p = r.realpage + if p then +-- setmetatableindex(actions,r) + actions.realpage = p + actions.view = r.view + end end end |