From 4bc28891615011ed3581836e9259434720e25830 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 4 Jul 2019 13:50:48 +0200 Subject: 2019-07-04 12:36:00 --- tex/context/base/mkiv/cldf-ini.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'tex/context/base/mkiv/cldf-ini.lua') diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua index 0778ced4e..ff4f5e3b1 100644 --- a/tex/context/base/mkiv/cldf-ini.lua +++ b/tex/context/base/mkiv/cldf-ini.lua @@ -326,6 +326,39 @@ end setmetatablecall(knownfunctions,function(t,n) return knownfunctions[n](n) end) +-- some protection + +do + + local stub = { } + local done = false + local message = function() + -- one time message + if not done then + report_cld("") + report_cld("use : slot = context.functions.register(f)") + report_cld("and : context.functions.unregister(slot)") + report_cld("") + done = true + end + end + + setmetatable(stub, { + __index = message, + __newindex = message, + }) + + function lua.getfunctionstable() + message() + return stub + end + + lua.get_functions_table = lua.getfunctionstable + +end + +-- so far + -- The next hack is a convenient way to define scanners at the Lua end and -- get them available at the TeX end. There is some dirty magic needed to -- prevent overload during format loading. -- cgit v1.2.3