summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-11-05 19:52:10 +0100
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-11-11 15:52:24 +0100
commit29c7784fd4ddd1bf20628f077992be125ec9d014 (patch)
tree6072adf7bafa2161dcf9f8e5176646bd3f712505
parentec78724a1df80ff8d5f10c8c2241bfaff270d71d (diff)
downloadluatexbase-29c7784fd4ddd1bf20628f077992be125ec9d014.tar.gz
Mplement support for setting callbacks to false.
-rw-r--r--luatexbase-mcb.dtx18
1 files changed, 15 insertions, 3 deletions
diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx
index 9e91065..43bfef9 100644
--- a/luatexbase-mcb.dtx
+++ b/luatexbase-mcb.dtx
@@ -210,8 +210,16 @@ See source file '\inFileName' for details.
% description used when adding the function to this callback. You can also
% remove all functions from a callback at once using
% \begin{verbatim}
-% luatexbase.reset_callback(name)
+% luatexbase.reset_callback(name, make_false)
% \end{verbatim}
+% The |make_false| argument is optional. If it is |true| (repeat: |true|, not
+% |false|) then the value |false| is registered in the callback, which has a
+% special meaning for some callback.
+%
+% Note that |reset_callback| is very invasive since it removes all functions
+% possibly installed by other packages in this callback. So, use it with care
+% if there is any chance that another package wants to share this callback
+% with you.
%
% When new functions are added at the beginning of the list, other functions
% are shifted down the list. To get the current rank of a function in a
@@ -731,7 +739,7 @@ end
% callback handler unless the callback is user-defined.
%
% \begin{macrocode}
-function reset_callback (name)
+function reset_callback (name, make_false)
if not name or name == "" then
err("unable to reset:\nno proper callback name passed")
return
@@ -740,7 +748,11 @@ function reset_callback (name)
return
end
if not lua_callbacks_defaults[name] then
- internalregister(name, nil)
+ if make_false == true then
+ internalregister(name, false)
+ else
+ internalregister(name, nil)
+ end
end
local l = callbacklist[name]
if l then