diff options
Diffstat (limited to 'Master/texmf-dist/source/luatex/luatexbase/luatexbase-mcb.dtx')
-rw-r--r-- | Master/texmf-dist/source/luatex/luatexbase/luatexbase-mcb.dtx | 83 |
1 files changed, 37 insertions, 46 deletions
diff --git a/Master/texmf-dist/source/luatex/luatexbase/luatexbase-mcb.dtx b/Master/texmf-dist/source/luatex/luatexbase/luatexbase-mcb.dtx index b944cd261e4..8b99a5257c7 100644 --- a/Master/texmf-dist/source/luatex/luatexbase/luatexbase-mcb.dtx +++ b/Master/texmf-dist/source/luatex/luatexbase/luatexbase-mcb.dtx @@ -1,8 +1,8 @@ % \iffalse meta-comment % -% Written in 2009, 2010 by Manuel Pégourié-Gonnard and Élie Roux. -% <mpg@elzevir.fr> -% <elie.roux@telecom-bretagne.eu> +% 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. % @@ -35,10 +35,7 @@ \preamble -Copyright (C) 2009 by Elie Roux <elie.roux@telecom-bretagne.eu> - -This work is under the CC0 license. -See source file '\inFileName' for details. +See the aforementioned source file(s) for copyright and licensing information. \endpreamble @@ -118,7 +115,7 @@ See source file '\inFileName' for details. % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \pkdate{luatexbase-mcb}{2010/10/10 v0.3} +% \pkdate{luatexbase-mcb}{2013/04/13 v0.5} % % \maketitle % @@ -286,48 +283,43 @@ See source file '\inFileName' for details. % % \subsubsection{Preliminaries} % -% Reload protection, especially for \plaintex. -% -% \begin{macrocode} - \csname lltxb@mcb@loaded\endcsname -\expandafter\let\csname lltxb@mcb@loaded\endcsname\endinput -% \end{macrocode} -% -% Catcode defenses. +% Catcode defenses and reload protection. % % \begin{macrocode} -\begingroup +\begingroup\catcode61\catcode48\catcode32=10\relax% = and space \catcode123 1 % { \catcode125 2 % } \catcode 35 6 % # - \toks0{}% - \def\x{}% + \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}% + \edef\x{\endlinechar13}% \def\y#1 #2 {% \toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}% \edef\x{\x \catcode#1 #2}}% - \y 123 1 % { - \y 125 2 % } - \y 35 6 % # - \y 10 12 % ^^J - \y 34 12 % " - \y 36 3 % $ $ + \y 13 5 % carriage return + \y 61 12 % = + \y 32 10 % space + \y 123 1 % { + \y 125 2 % } + \y 35 6 % # + \y 64 11 % @ (letter) + \y 10 12 % new line ^^J \y 39 12 % ' \y 40 12 % ( \y 41 12 % ) - \y 42 12 % * - \y 43 12 % + - \y 44 12 % , \y 45 12 % - \y 46 12 % . \y 47 12 % / - \y 60 12 % < - \y 61 12 % = - \y 64 11 % @ (letter) - \y 62 12 % > - \y 95 12 % _ (other) + \y 58 12 % : + \y 91 12 % [ + \y 93 12 % ] + \y 94 7 % ^ \y 96 12 % ` - \edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}% -\expandafter\y\csname lltxb@mcb@AtEnd\endcsname + \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}% + \edef\y#1{\noexpand\expandafter\endgroup% + \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax% + \noexpand\else \noexpand\expandafter\noexpand\endinput% + \noexpand\fi}% +\expandafter\y\csname luatexbase@mcb@sty@endinput\endcsname% % \end{macrocode} % % Package declaration. @@ -340,7 +332,7 @@ See source file '\inFileName' for details. \let\x\ProvidesPackage \fi \expandafter\endgroup -\x{luatexbase-mcb}[2010/10/10 v0.3 Callback management for LuaTeX] +\x{luatexbase-mcb}[2013/04/13 v0.5 Callback management for LuaTeX] % \end{macrocode} % % Make sure \luatex is used. @@ -361,12 +353,11 @@ See source file '\inFileName' for details. \let\x\PackageError \fi \expandafter\endgroup - \x{luatexbase-attr}{LuaTeX is required for this package. Aborting.}{% + \x{luatexbase-mcb}{LuaTeX is required for this package. Aborting.}{% This package can only be used with the LuaTeX engine^^J% (command `lualatex' or `luatex').^^J% Package loading has been stopped to prevent additional errors.} - \lltxb@mcb@AtEnd - \expandafter\endinput + \expandafter\luatexbase@mcb@sty@endinput% \fi % \end{macrocode} % @@ -388,7 +379,7 @@ See source file '\inFileName' for details. % That's all folks! % % \begin{macrocode} -\lltxb@mcb@AtEnd +\luatexbase@mcb@sty@endinput% %</texpackage> % \end{macrocode} % @@ -404,11 +395,11 @@ See source file '\inFileName' for details. module('luatexbase', package.seeall) local err, warning, info = luatexbase.provides_module({ name = "luatexbase-mcb", - version = 0.2, - date = "2010/05/12", + 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} @@ -569,7 +560,7 @@ local function listhandler (name) for _, f in ipairs(callbacklist[name]) do ret = f.func(head, ...) if ret == false then - warn("function '%s' returned false\nin callback '%s'", + warning("function '%s' returned false\nin callback '%s'", f.description, name) break end @@ -743,7 +734,7 @@ function remove_from_callback (name, description) end table.remove(l, index) info("removing '%s'\nfrom '%s'", description, name) - if table.maxn(l) == 0 then + if #l == 0 then callbacklist[name] = nil if not lua_callbacks_defaults[name] then register_callback(name, nil) |