From 974640d66e61e81cb197ad96fdff7b08343e4c5a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 6 Mar 2021 21:58:15 +0000 Subject: context git-svn-id: svn://tug.org/texlive/trunk@58167 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/context/base/mkiv/page-ini.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Master/texmf-dist/tex/context/base/mkiv/page-ini.lua') 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 -- cgit v1.2.3