diff options
| author | Elie Roux <elie.roux@telecom-bretagne.eu> | 2013-05-03 01:18:55 -0700 | 
|---|---|---|
| committer | Elie Roux <elie.roux@telecom-bretagne.eu> | 2013-05-03 01:18:55 -0700 | 
| commit | 00e3aee4a50dc9d042bf792556b727761f20ae02 (patch) | |
| tree | 1cf5657c28e3620e7261aa89940f1cadf908407f /luatexbase-mcb.dtx | |
| parent | 12e95bc9acd7c2d172a0b47b5832cbc56eb4fa54 (diff) | |
| parent | c5837a5e38f2324ce7960840b609c290337ff160 (diff) | |
| download | luatexbase-00e3aee4a50dc9d042bf792556b727761f20ae02.tar.gz | |
Merge pull request #5 from phi-gamma/master
drop `module()`; incorporate Stephans’s suggestions
Diffstat (limited to 'luatexbase-mcb.dtx')
| -rw-r--r-- | luatexbase-mcb.dtx | 20 | 
1 files changed, 19 insertions, 1 deletions
diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx index f4d6448..0c04d4d 100644 --- a/luatexbase-mcb.dtx +++ b/luatexbase-mcb.dtx @@ -392,7 +392,8 @@ See the aforementioned source file(s) for copyright and licensing information.  %    \subsubsection{Module identification}  %  %    \begin{macrocode} -module('luatexbase', package.seeall) +luatexbase          = luatexbase or { } +local luatexbase    = luatexbase  local err, warning, info, log = luatexbase.provides_module({      name          = "luatexbase-mcb",      version       = 0.5, @@ -404,6 +405,17 @@ local err, warning, info, log = luatexbase.provides_module({  })  %    \end{macrocode}  % +%    First we declare the function references for the entire scope. +% +%    \begin{macrocode} +local add_to_callback +local call_callback +local create_callback +local priority_in_callback +local remove_from_callback +local reset_callback +%    \end{macrocode} +%  %    \subsubsection{Housekeeping}  %  %    The main table: keys are callback names, and values are the associated @@ -690,6 +702,7 @@ function add_to_callback (name,func,description,priority)      log("inserting '%s'\nat position %s in '%s'",        description, priority, name)  end +luatexbase.add_to_callback = add_to_callback  %    \end{macrocode}  %  %    Remove a function from a callback. First check arguments. @@ -742,6 +755,7 @@ function remove_from_callback (name, description)      end      return  end +luatexbase.remove_from_callback = remove_from_callback  %    \end{macrocode}  %  %    Remove all the functions registered in a callback. Unregisters the @@ -767,6 +781,7 @@ function reset_callback (name, make_false)          end      end  end +luatexbase.reset_callback = reset_callback  %    \end{macrocode}  %  %    Get a function's priority in a callback list, or false if the function is @@ -788,6 +803,7 @@ function priority_in_callback (name, description)      end      return false  end +luatexbase.priority_in_callback = priority_in_callback  %    \end{macrocode}  %  %    \subsubsection{Public functions for user-defined callbacks} @@ -827,6 +843,7 @@ function create_callback(name, ctype, default)      lua_callbacks_defaults[name] = default      callbacktypes[name] = ctype  end +luatexbase.create_callback = create_callback  %    \end{macrocode}  %  %    This function calls a callback. It can only call a callback created by @@ -855,6 +872,7 @@ function call_callback(name, ...)      end      return f(...)  end +luatexbase.call_callback = call_callback  %    \end{macrocode}  %  %    That's all folks!  | 
