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, 11 insertions, 18 deletions
diff --git a/tex/context/base/luat-cbk.lua b/tex/context/base/luat-cbk.lua
index c4f0aba02..6622c64cd 100644
--- a/tex/context/base/luat-cbk.lua
+++ b/tex/context/base/luat-cbk.lua
@@ -34,13 +34,10 @@ 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 = callback.register
-local find_callback = callback.find
-local list_callbacks = callback.list
-
+local register_callback, find_callback, list_callbacks = callback.register, callback.find, callback.list
local frozen, stack, list = { }, { }, callbacks.list
-if not list then -- otherwise counters get reset
+if not callbacks.list then -- otherwise counters get reset
list = utilities.storage.allocate(list_callbacks())
@@ -116,6 +113,15 @@ 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
@@ -305,16 +311,3 @@ 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