diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-04-30 03:08:47 -0700 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-04-30 03:08:47 -0700 |
commit | 12e95bc9acd7c2d172a0b47b5832cbc56eb4fa54 (patch) | |
tree | f2d1d57a0f5e0cac8c8f9fdea3ba12a6b6805f90 /luatexbase-mcb.dtx | |
parent | 520f6b3ccb737a949ac73dcd1d8c152a044db0ba (diff) | |
parent | ec9027b5a79546bf9babb7d97b778551cd25b29e (diff) | |
download | luatexbase-12e95bc9acd7c2d172a0b47b5832cbc56eb4fa54.tar.gz |
Merge pull request #2 from phi-gamma/master
pull changes from eroux
Diffstat (limited to 'luatexbase-mcb.dtx')
-rw-r--r-- | luatexbase-mcb.dtx | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx index b26f56f..f4d6448 100644 --- a/luatexbase-mcb.dtx +++ b/luatexbase-mcb.dtx @@ -2,6 +2,7 @@ % % Copyright 2009, 2010 by Élie Roux <elie.roux@telecom-bretagne.eu> % Copyright 2010, 2011 by Manuel Pégourié-Gonnard <mpg@elzevir.fr> +% Copyright 2013 by Philipp Gesang <philipp.gesang@alumni.uni-heidelberg.de> % % This work is under the CC0 license. % @@ -114,7 +115,7 @@ See the aforementioned source file(s) for copyright and licensing information. % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \pkdate{luatexbase-mcb}{2011/05/24 v0.4} +% \pkdate{luatexbase-mcb}{2013/04/13 v0.5} % % \maketitle % @@ -141,7 +142,7 @@ See the aforementioned source file(s) for copyright and licensing information. % % \luatex provides an extremely interesting feature, named callbacks. It % allows to call some Lua functions at some points of the \TeX\ algorithm (a -% \emph{callback}), like when \TeX\ breaks likes, puts vertical spaces, etc. +% \emph{callback}), like when \TeX\ breaks lines, puts vertical spaces, etc. % The \luatex core offers a function called \texttt{callback.register} that % enables to register a function in a callback. % @@ -156,7 +157,7 @@ See the aforementioned source file(s) for copyright and licensing information. % \begin{description} % \item[simple] is for functions that don't return anything: they are called % in order, all with the same argument; -% \item[data] is for functions receiving a piece of data of nay type +% \item[data] is for functions receiving a piece of data of any type % except node list head (and possibly other arguments) and returning it % (possibly modified): the functions are called in order, and each is % passed the return value of the previous (and the other arguments @@ -166,8 +167,8 @@ See the aforementioned source file(s) for copyright and licensing information. % modified node list, or the boolean values |true| or |false|. The % functions are chained the same way as for \emph{data} except that for % the following. If -% one function returns |false|, then |false| is immediately return and the -% following functions are \emph{not} called. If one function returns +% one function returns |false|, then |false| is immediately returned and +% the following functions are \emph{not} called. If one function returns % |true|, then the same head is passed to the next function. If all % functions return |true|, then |true| is returned, otherwise the return % value of the last function not returning |true| is used. @@ -331,7 +332,7 @@ See the aforementioned source file(s) for copyright and licensing information. \let\x\ProvidesPackage \fi \expandafter\endgroup -\x{luatexbase-mcb}[2011/05/24 v0.4 Callback management for LuaTeX] +\x{luatexbase-mcb}[2013/04/13 v0.5 Callback management for LuaTeX] % \end{macrocode} % % Make sure \luatex is used. @@ -392,13 +393,13 @@ See the aforementioned source file(s) for copyright and licensing information. % % \begin{macrocode} module('luatexbase', package.seeall) -local err, warning, info = luatexbase.provides_module({ +local err, warning, info, log = luatexbase.provides_module({ name = "luatexbase-mcb", - version = 0.4, - date = "2011/05/24", + version = 0.5, + date = "2013/04/13", description = "register several functions in a callback", - author = "Hans Hagen, Elie Roux and Manuel Pegourie-Gonnard", - copyright = "Hans Hagen, Elie Roux and Manuel Pegourie-Gonnard", + author = "Hans Hagen, Elie Roux, Manuel Pegourie-Gonnard and Philipp Gesang", + copyright = "Hans Hagen, Elie Roux, Manuel Pegourie-Gonnard and Philipp Gesang", license = "CC0", }) % \end{macrocode} @@ -686,7 +687,7 @@ function add_to_callback (name,func,description,priority) warning("several functions in '%s',\n" .."only one will be active.", name) end - info("inserting '%s'\nat position %s in '%s'", + log("inserting '%s'\nat position %s in '%s'", description, priority, name) end % \end{macrocode} @@ -732,8 +733,8 @@ function remove_from_callback (name, description) return end table.remove(l, index) - info("removing '%s'\nfrom '%s'", description, name) - if table.maxn(l) == 0 then + log("removing '%s'\nfrom '%s'", description, name) + if #l == 0 then callbacklist[name] = nil if not lua_callbacks_defaults[name] then register_callback(name, nil) @@ -755,11 +756,11 @@ function reset_callback (name, make_false) err("unable to reset '%s':\nis not a valid callback", name) return end - info("resetting callback '%s'", name) + log("resetting callback '%s'", name) callbacklist[name] = nil if not lua_callbacks_defaults[name] then if make_false == true then - info("setting '%s' to false", name) + log("setting '%s' to false", name) register_callback(name, false) else register_callback(name, nil) @@ -822,7 +823,7 @@ function create_callback(name, ctype, default) err("unable to create callback '%s':\ntype '%s' undefined", name, ctype) return nil end - info("creating '%s' type %s", name, ctype) + log("creating '%s' type %s", name, ctype) lua_callbacks_defaults[name] = default callbacktypes[name] = ctype end |