summaryrefslogtreecommitdiff
path: root/tex/context/base/luat-cbk.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/luat-cbk.lua')
-rw-r--r--tex/context/base/luat-cbk.lua43
1 files changed, 17 insertions, 26 deletions
diff --git a/tex/context/base/luat-cbk.lua b/tex/context/base/luat-cbk.lua
index 9ecf64264..454c89425 100644
--- a/tex/context/base/luat-cbk.lua
+++ b/tex/context/base/luat-cbk.lua
@@ -53,40 +53,31 @@ local delayed = table.tohash {
}
-if not callback.original_register then
-
- callback.original_register = register_callback
-
- local original_register = register_callback
-
- if trace_calls then
+if trace_calls then
- local functions = { }
+ local functions = { }
+ local original = register_callback
- register_callback = function(name,func)
- if type(func) == "function" then
- if functions[name] then
- functions[name] = func
- return find_callback(name)
- else
- functions[name] = func
- local cnuf = function(...)
- list[name] = list[name] + 1
- return functions[name](...)
- end
- return original_register(name,cnuf)
- end
+ register_callback = function(name,func)
+ if type(func) == "function" then
+ if functions[name] then
+ functions[name] = func
+ return find_callback(name)
else
- return original_register(name,func)
+ functions[name] = func
+ local cnuf = function(...)
+ list[name] = list[name] + 1
+ return functions[name](...)
+ end
+ return original(name,cnuf)
end
+ else
+ return original(name,func)
end
-
end
end
-callback.register = register_callback
-
local function frozen_message(what,name)
report_callbacks("not %s frozen '%s' (%s)",what,name,frozen[name])
end
@@ -133,7 +124,7 @@ end
function callbacks.freeze(name,freeze)
freeze = type(freeze) == "string" and freeze
if find(name,"%*") then
- local pattern = name -- string.simpleesc(name)
+ local pattern = name -- string.partialescapedpattern(name)
for name, _ in next, list do
if find(name,pattern) then
frozen[name] = freeze or frozen[name] or "frozen"