summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--luatexbase-mcb.dtx14
1 files changed, 11 insertions, 3 deletions
diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx
index 3740e06..6d23eb8 100644
--- a/luatexbase-mcb.dtx
+++ b/luatexbase-mcb.dtx
@@ -572,7 +572,7 @@ local function listhandler (name)
for _, f in ipairs(callbacklist[name]) do
ret = f.func(head, ...)
if ret == false then
- log("function '%s' returned false\nin callback '%s'",
+ log("function '%s' returned false in callback '%s'",
f.description, name)
break
end
@@ -611,14 +611,22 @@ local function firsthandler (name)
end
% \end{macrocode}
%
-% Handler for |simple| callbacks.
+% Handler for |simple| callbacks. If a function returns false, we return
+% this value, without going through other functions.
%
% \begin{macrocode}
local function simplehandler (name)
return function(...)
+ local ret = true
for _, f in ipairs(callbacklist[name]) do
- f.func(...)
+ ret = f.func(...)
+ if ret == false then
+ log("function '%s' returned false in callback '%s'",
+ f.description, name)
+ return false
+ end
end
+ return ret
end
end
% \end{macrocode}