summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/lua-ul/pre_append_to_vlist_filter.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-03-14 22:10:45 +0000
committerKarl Berry <karl@freefriends.org>2020-03-14 22:10:45 +0000
commitca238fa81c51ff5ba715598b5082b5637f917456 (patch)
tree23986f4555dd33bee98e789cc3475f46a68b5104 /Master/texmf-dist/tex/lualatex/lua-ul/pre_append_to_vlist_filter.lua
parentae2a5f357df974b9a9140e188de98de09c83cf36 (diff)
lua-ul (13mar20)
git-svn-id: svn://tug.org/texlive/trunk@54304 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/lua-ul/pre_append_to_vlist_filter.lua')
-rw-r--r--Master/texmf-dist/tex/lualatex/lua-ul/pre_append_to_vlist_filter.lua68
1 files changed, 68 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/lualatex/lua-ul/pre_append_to_vlist_filter.lua b/Master/texmf-dist/tex/lualatex/lua-ul/pre_append_to_vlist_filter.lua
new file mode 100644
index 00000000000..1417b588625
--- /dev/null
+++ b/Master/texmf-dist/tex/lualatex/lua-ul/pre_append_to_vlist_filter.lua
@@ -0,0 +1,68 @@
+--
+-- This is file `pre_append_to_vlist_filter.lua',
+-- generated with the docstrip utility.
+--
+-- The original source files were:
+--
+-- lua-ul.dtx (with options: `callback')
+--
+-- Copyright (C) 2020 by Marcel Krueger
+--
+-- This file may be distributed and/or modified under the
+-- conditions of the LaTeX Project Public License, either
+-- version 1.3c of this license or (at your option) any later
+-- version. The latest version of this license is in:
+--
+-- http://www.latex-project.org/lppl.txt
+--
+-- and version 1.3 or later is part of all distributions of
+-- LaTeX version 2005/12/01 or later.
+if luatexbase.callbacktypes.pre_append_to_vlist_filter then
+ return
+end
+
+local call_callback = luatexbase.call_callback
+local flush_node = node.flush_node
+local prepend_prevdepth = node.prepend_prevdepth
+local callback_define
+
+for i=1,5 do
+ local name, func = debug.getupvalue(luatexbase.disable_callback, i)
+ if name == 'callback_register' then
+ callback_define = func
+ break
+ end
+end
+if not callback_define then
+ error[[Unable to find callback.define]]
+end
+
+local function filtered_append_to_vlist_filter(box,
+ locationcode,
+ prevdepth,
+ mirrored)
+ local current = call_callback("pre_append_to_vlist_filter",
+ box, locationcode, prevdepth,
+ mirrored)
+ if not current then
+ flush_node(box)
+ return
+ elseif current == true then
+ current = box
+ end
+ return call_callback("append_to_vlist_filter",
+ box, locationcode, prevdepth, mirrored)
+end
+
+callback_define('append_to_vlist_filter',
+ filtered_append_to_vlist_filter)
+luatexbase.callbacktypes.append_to_vlist_filter = nil
+luatexbase.create_callback('append_to_vlist_filter', 'exclusive',
+ function(n, _, prevdepth)
+ return prepend_prevdepth(n, prevdepth)
+ end)
+luatexbase.create_callback('pre_append_to_vlist_filter',
+ 'list', false)
+--
+--
+-- End of file `pre_append_to_vlist_filter.lua'.