summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-not.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/strc-not.lua')
-rw-r--r--tex/context/base/strc-not.lua16
1 files changed, 7 insertions, 9 deletions
diff --git a/tex/context/base/strc-not.lua b/tex/context/base/strc-not.lua
index 40b78d59f..882e00a44 100644
--- a/tex/context/base/strc-not.lua
+++ b/tex/context/base/strc-not.lua
@@ -8,6 +8,7 @@ if not modules then modules = { } end modules ['strc-not'] = {
local format = string.format
local next = next
+local texcount = tex.count
local trace_notes = false trackers.register("structures.notes", function(v) trace_notes = v end)
local trace_references = false trackers.register("structures.notes.references", function(v) trace_references = v end)
@@ -23,9 +24,6 @@ local notes = structures.notes
local references = structures.references
local counterspecials = counters.specials
-local texgetcount = tex.getcount
-local texgetbox = tex.getbox
-
notes.states = notes.states or { }
lists.enhancers = lists.enhancers or { }
@@ -93,10 +91,10 @@ end
local function getn(tag)
local nd = notedata[tag]
- return nd and #nd or 0
+ return (nd and #nd) or 0
end
-notes.get = get
+notes.get = get
notes.getn = getn
-- we could make a special enhancer
@@ -191,7 +189,7 @@ local function hascontent(tag)
local ok = notestates[tag]
if ok then
if ok.kind == "insert" then
- ok = texgetbox(ok.number)
+ ok = tex.box[ok.number]
if ok then
ok = tbs.list
ok = lst and lst.next
@@ -259,7 +257,7 @@ function notes.checkpagechange(tag) -- called before increment !
end
elseif current then
-- we need to locate the next one, best guess
- if texgetcount("realpageno") > current.pagenumber.number then
+ if texcount.realpageno > current.pagenumber.number then
counters.reset(tag)
end
end
@@ -282,7 +280,7 @@ commands.postponenotes = notes.postpone
function notes.setsymbolpage(tag,n,l)
local l = l or listindex(tag,n)
if l then
- local p = texgetcount("realpageno")
+ local p = texcount.realpageno
if trace_notes or trace_references then
report_notes("note %a of %a with list index %a gets symbol page %a",n,tag,l,p)
end
@@ -384,7 +382,7 @@ function commands.flushnotes(tag,whatkind,how) -- store and postpone
local rp = get(tag,i)
rp = rp and rp.references
rp = rp and rp.symbolpage or 0
- if rp > texgetcount("realpageno") then
+ if rp > texcount.realpageno then
state.start = i
return
end