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.lua29
1 files changed, 18 insertions, 11 deletions
diff --git a/tex/context/base/luat-cbk.lua b/tex/context/base/luat-cbk.lua
index 6622c64cd..c4f0aba02 100644
--- a/tex/context/base/luat-cbk.lua
+++ b/tex/context/base/luat-cbk.lua
@@ -34,10 +34,13 @@ functions.</p>
local trace_callbacks = false trackers.register("system.callbacks", function(v) trace_callbacks = v end)
local trace_calls = false -- only used when analyzing performance and initializations
-local register_callback, find_callback, list_callbacks = callback.register, callback.find, callback.list
+local register_callback = callback.register
+local find_callback = callback.find
+local list_callbacks = callback.list
+
local frozen, stack, list = { }, { }, callbacks.list
-if not callbacks.list then -- otherwise counters get reset
+if not list then -- otherwise counters get reset
list = utilities.storage.allocate(list_callbacks())
@@ -113,15 +116,6 @@ function callbacks.report()
end
end
-function callbacks.table()
- local NC, NR, verbatim = context.NC, context.NR, context.type
- context.starttabulate { "|l|l|p|" }
- for name, _ in sortedhash(list) do
- NC() verbatim(name) NC() verbatim(state(name)) NC() context(frozen[name] or "") NC() NR()
- end
- context.stoptabulate()
-end
-
function callbacks.freeze(name,freeze)
freeze = type(freeze) == "string" and freeze
if find(name,"%*") then
@@ -311,3 +305,16 @@ function garbagecollector.check(size,criterium)
end
end
end
+
+-- this will move
+
+commands = commands or { }
+
+function commands.showcallbacks()
+ local NC, NR, verbatim = context.NC, context.NR, context.type
+ context.starttabulate { "|l|l|p|" }
+ for name, _ in sortedhash(list) do
+ NC() verbatim(name) NC() verbatim(state(name)) NC() context(frozen[name] or "") NC() NR()
+ end
+ context.stoptabulate()
+end