summaryrefslogtreecommitdiff
path: root/tex/context/base/scrn-wid.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-06-08 20:40:24 +0300
committerMarius <mariausol@gmail.com>2011-06-08 20:40:24 +0300
commite5fe861660d5cf60cfeb67f7e57f659b309e9613 (patch)
treef5bc4ea0cd61f18c096f0fd5df8cf439700ba71e /tex/context/base/scrn-wid.lua
parentb17f22aa285224dcf5b1dbccd795bc73b9a16426 (diff)
downloadcontext-e5fe861660d5cf60cfeb67f7e57f659b309e9613.tar.gz
beta 2011.06.08 19:06
Diffstat (limited to 'tex/context/base/scrn-wid.lua')
-rw-r--r--tex/context/base/scrn-wid.lua18
1 files changed, 15 insertions, 3 deletions
diff --git a/tex/context/base/scrn-wid.lua b/tex/context/base/scrn-wid.lua
index 7b1dd940a..90e353306 100644
--- a/tex/context/base/scrn-wid.lua
+++ b/tex/context/base/scrn-wid.lua
@@ -28,6 +28,10 @@ local nodeinjections = backends.nodeinjections
local variables = interfaces.variables
local v_auto = variables.auto
+local trace_attachments = false trackers.register("widgets.attachments", function(v) trace_attachments = v end)
+
+local report_attachments = logs.reporter("widgets","attachments")
+
-- Symbols
function commands.presetsymbollist(list)
@@ -66,10 +70,13 @@ local function checkbuffer(specification)
end
end
-function attachments.register(specification)
- checkregistered(specification)
+function attachments.register(specification) -- beware of tag/registered mixup(tag is namespace)
+ local registered = checkregistered(specification)
checkbuffer(specification)
- attachments[lastregistered] = specification
+ attachments[registered] = specification
+ if trace_attachments then
+ report_attachments("registering '%s'",registered)
+ end
return specification
end
@@ -77,12 +84,17 @@ function attachments.insert(specification)
local registered = checkregistered(specification)
local r = attachments[registered]
if r then
+ if trace_attachments then
+ report_attachments("including registered '%s'",registered)
+ end
for k, v in next, r do
local s = specification[k]
if s == "" then
specification[k] = v
end
end
+ elseif trace_attachments then
+ report_attachments("including unregistered '%s'",registered)
end
checkbuffer(specification)
return nodeinjections.attachfile(specification)