summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/page-ini.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-ini.lua17
1 files changed, 15 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua
index 17f4c44dadd..924e01b2aa8 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua
@@ -8,7 +8,7 @@ if not modules then modules = { } end modules ['page-ini'] = {
local tonumber, rawget, rawset, type, next = tonumber, rawget, rawset, type, next
local match = string.match
-local sort, tohash, insert, remove = table.sort, table.tohash, table.insert, table.remove
+local sort, tohash, insert, remove, sortedkeys = table.sort, table.tohash, table.insert, table.remove, table.sortedkeys
local settings_to_array, settings_to_hash = utilities.parsers.settings_to_array, utilities.parsers.settings_to_hash
local texgetcount = tex.getcount
@@ -87,10 +87,23 @@ function pages.mark(name,list)
end
end
+local tobemarked = { }
+
+function pages.markedlist(realpage)
+ if realpage then
+ local m = rawget(tobemarked,realpage) or rawget(data,realpage)
+ return m and next(m) and sortedkeys(m)
+ end
+end
+
local function marked(name)
local realpage = texgetcount("realpageno")
for i=last,realpage-1 do
- rawset(data,i,nil)
+ local di = data[i]
+ if di then
+ tobemarked[i] = di
+ rawset(data,i,nil)
+ end
end
local pagedata = rawget(data,realpage)
return pagedata and pagedata[name] and true or false