diff options
author | Karl Berry <karl@freefriends.org> | 2016-04-22 22:14:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-04-22 22:14:39 +0000 |
commit | fc4466b32ed330a956ac603b00fd145524cff49a (patch) | |
tree | 2c50e2b8de13aa9233b2c76dffe201558f169e86 /Master/texmf-dist/tex/context/base/page-pst.lua | |
parent | 50e2368597d5f6fe2057195d0ae6a9f2044923e4 (diff) |
context (22apr16)
git-svn-id: svn://tug.org/texlive/trunk@40691 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/page-pst.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/page-pst.lua | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/Master/texmf-dist/tex/context/base/page-pst.lua b/Master/texmf-dist/tex/context/base/page-pst.lua deleted file mode 100644 index 472bdbabed5..00000000000 --- a/Master/texmf-dist/tex/context/base/page-pst.lua +++ /dev/null @@ -1,105 +0,0 @@ -if not modules then modules = { } end modules ['page-pst'] = { - version = 1.001, - comment = "companion to page-pst.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - --- todo: adapt message - -local tonumber, next, type = tonumber, next, type -local find, validstring = string.find, string.valid - -local context = context -local implement = interfaces.implement - -local texgetcount = tex.getcount -local texsetcount = tex.setcount - -local sortedkeys = table.sortedkeys -local formatters = string.formatters - -local cache = { } - -local function flush(page) - local c = cache[page] - if c then - for i=1,#c do - -- characters.showstring(c[i]) - context.viafile(c[i],formatters["page.%s"](validstring(page,"nopage"))) - end - cache[page] = nil - end -end - -local function setnextpage() - local n = next(cache) and sortedkeys(cache)[1] - if not n then - n = 0 -- nothing in the cache - elseif n == 0 then - n = -1 -- generic buffer (0) - elseif n > 0 then - -- upcoming page (realpageno) - end - texsetcount("global","c_page_postponed_blocks_next_page",n) -end - -local function flushpostponedblocks(specification) - -- we need to flush previously pending pages as well and the zero - -- slot is the generic one so that one is always flushed - local t = sortedkeys(cache) - local p = tonumber(specification.page) or texgetcount("realpageno") or 0 - for i=1,#t do - local ti = t[i] - if ti <= p then - flush(ti) - else - break - end - end - setnextpage() -end - -implement { - name = "flushpostponedblocks", - actions = flushpostponedblocks, - arguments = { - { - { "page" } - } - } -} - -local function registerpostponedblock(page) - if type(page) == "string" then - if find(page,"^+") then - page = texgetcount("realpageno") + (tonumber(page) or 1) -- future delta page - else - page = tonumber(page) or 0 -- preferred page or otherwise first possible occasion - end - end - if not page then - page = 0 - end - local c = cache[page] - if not c then - c = { } - cache[page] = c - end - c[#c+1] = buffers.raw("postponedblock") - buffers.erase("postponedblock") - if page == 0 then - interfaces.showmessage("layouts",3,#c) - else - interfaces.showmessage("layouts",3,formatters["%s (realpage: %s)"](#c,page)) - end - setnextpage() -end - -implement { - name = "registerpostponedblock", - actions = registerpostponedblock, - arguments = "string" -} - |