summaryrefslogtreecommitdiff
path: root/tex/context/base/core-dat.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/core-dat.lua')
-rw-r--r--tex/context/base/core-dat.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/tex/context/base/core-dat.lua b/tex/context/base/core-dat.lua
index 826d3a675..242d362d0 100644
--- a/tex/context/base/core-dat.lua
+++ b/tex/context/base/core-dat.lua
@@ -21,13 +21,17 @@ local trace_pagestates = false trackers.register("job.pagestates", function(v)
local report_dataset = logs.reporter("dataset")
local report_pagestate = logs.reporter("pagestate")
-local allocate = utilities.storage.allocate
+local allocate = utilities.storage.allocate
local settings_to_hash = utilities.parsers.settings_to_hash
-local texcount = tex.count
-local formatters = string.formatters
-local v_yes = interfaces.variables.yes
-local new_latelua = nodes.pool.latelua
+local texgetcount = tex.getcount
+local texsetcount = tex.setcount
+
+local formatters = string.formatters
+
+local v_yes = interfaces.variables.yes
+
+local new_latelua = nodes.pool.latelua
local collected = allocate()
local tobesaved = allocate()
@@ -86,7 +90,7 @@ local function setdata(settings)
set.index = index
data.index = index
data.order = index
- data.realpage = texcount.realpageno
+ data.realpage = texgetcount("realpageno")
if trace_datasets then
report_dataset("action %a, name %a, tag %a, index %a","assign delayed",name,tag,index)
end
@@ -101,7 +105,7 @@ datasets.setdata = setdata
function datasets.extend(name,tag)
local set = sets[name]
local order = set.order + 1
- local realpage = texcount.realpageno
+ local realpage = texgetcount("realpageno")
set.order = order
local t = tobesaved[name][tag]
t.realpage = realpage
@@ -207,7 +211,7 @@ local function setstate(settings)
else
tag = tonumber(tag) or tag -- autonumber saves keys
end
- local realpage = texcount.realpageno
+ local realpage = texgetcount("realpageno")
local data = realpage
list[tag] = data
if trace_pagestates then
@@ -219,7 +223,7 @@ end
pagestates.setstate = setstate
function pagestates.extend(name,tag)
- local realpage = texcount.realpageno
+ local realpage = texgetcount("realpageno")
if trace_pagestates then
report_pagestate("action %a, name %a, tag %a, preset %a","synchronize",name,tag,realpage)
end
@@ -261,9 +265,5 @@ end
function commands.setpagestaterealpageno(name,tag)
local t = collected[name]
t = t and (t[tag] or t[tonumber(tag)])
- if t then
- texcount.realpagestateno = t
- else
- texcount.realpagestateno = texcount.realpageno
- end
+ texsetcount("realpagestateno",t or texgetcount("realpageno"))
end