diff options
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | luatexbase-attr.dtx | 98 | ||||
-rw-r--r-- | luatexbase-cctb.dtx | 21 | ||||
-rw-r--r-- | luatexbase-loader.dtx | 4 | ||||
-rw-r--r-- | luatexbase-mcb.dtx | 12 | ||||
-rw-r--r-- | luatexbase-modutils.dtx | 15 | ||||
-rw-r--r-- | luatexbase.dtx | 8 |
7 files changed, 79 insertions, 86 deletions
@@ -1,12 +1,13 @@ Changes in the luatexbase package/bundle -2013/05/04 v0.6 +2013/05/11 v0.6 all - move away from the module() function (deprecated in Lua 5.2) + - attr, loader and cctb now use provides_module attr - hack to make luatexbase and luatex.sty compatible for attribute allocation (same thing should be done for catcodetables) - - adding whatsit nodes allocation functions (see doc) + - adding user-defined whatsit node allocation functions (see doc) modutils - adding functions to check the availability and version of a module - fixing small error in module date requirement @@ -32,7 +33,7 @@ - fixing a bug printing "luatexbase-attr" in all documents in plain TeX -2011/00/24 v0.4 +2011/05/24 v0.4 cctb - implement catcode table stacks à la luatex.sty - fix \CatcodeTableLaTeX(Package): 10 (newline aka ^^J) was catcoded diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx index 99b853a..c6a7040 100644 --- a/luatexbase-attr.dtx +++ b/luatexbase-attr.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. % @@ -109,7 +110,7 @@ See the aforementioned source file(s) for copyright and licensing information. % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \pkdate{luatexbase-attr}{v0.4 2011-05-24} +% \pkdate{luatexbase-attr}{v0.6 2013-05-11} % % \maketitle % @@ -230,7 +231,7 @@ See the aforementioned source file(s) for copyright and licensing information. \let\x\ProvidesPackage \fi \expandafter\endgroup -\x{luatexbase-attr}[2011/05/24 v0.4 Attributes allocation for LuaTeX] +\x{luatexbase-attr}[2013/05/11 v0.6 Attributes allocation for LuaTeX] % \end{macrocode} % % Make sure \luatex is used. @@ -261,14 +262,17 @@ See the aforementioned source file(s) for copyright and licensing information. % % \subsubsection{Primitives needed} % -% Load \pk{luatexbase-compat}. +% First load \pk{luatexbase-modutils} (hence \pk{luatexbase-loader} +% and \pk{luatexbase-compat}), and make sure \pk{luatex.sty} is loaded too. % % \begin{macrocode} \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname RequirePackage\endcsname\relax - \input luatexbase-compat.sty + \input luatexbase-modutils.sty + \input luatex.sty \else - \RequirePackage{luatexbase-compat} + \RequirePackage{luatexbase-modutils} + \RequirePackage{luatex} \fi % \end{macrocode} % @@ -282,18 +286,7 @@ See the aforementioned source file(s) for copyright and licensing information. % % \subsubsection{Load supporting Lua module} % -% First load \pk{luatexbase-loader} (hence \pk{luatexbase-compat}), then -% the supporting Lua module. We make sure \verb|luatex.sty| is loaded. -% % \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname RequirePackage\endcsname\relax - \input luatexbase-loader.sty - \input luatex.sty -\else - \RequirePackage{luatexbase-loader} - \RequirePackage{luatex} -\fi \luatexbase@directlua{require('luatexbase.attr')} % \end{macrocode} % @@ -360,23 +353,15 @@ local user_defined_t = nodesubtype"user_defined" local unassociated = "__unassociated" luatexbase = luatexbase or { } local luatexbase = luatexbase -% \end{macrocode} -% -% We improvise a basic logging facility. -% -% \begin{macrocode} -local reporter = function (log, category, ...) - if log == true then - texiowrite_nl("log", "("..category..") ") - texiowrite("log", stringformat(...)) - else - texiowrite_nl("("..category..") ") - texiowrite(stringformat(...)) - end -end -local warning = function (...) reporter (false, "warning", ...) end ------ info = function (...) reporter (false, "info", ...) end -local log = function (...) reporter (true, "log", ...) end +local err, warning, info, log = luatexbase.provides_module({ + name = "luatexbase-attr", + version = 0.6, + date = "2013/05/11", + description = "Attributes allocation for LuaTeX", + author = "Elie Roux, Manuel Pegourie-Gonnard and Philipp Gesang", + copyright = "Elie Roux, Manuel Pegourie-Gonnard and Philipp Gesang", + license = "CC0", +}) % \end{macrocode} % % This table holds the values of the allocated attributes, indexed by name. @@ -458,7 +443,11 @@ end luatexbase.unset_attribute = unset_attribute % \end{macrocode} % -% User whatsit allocation (experimental). +% Allocation of user-defined whatsit nodes (experimental). +% User-defined whatsit nodes (or user whatsits) are ignored by the +% \luatex engine. They can thus be used to store information in +% node lists without doing any harm. User whatsits can be +% distinguished by an id that is stored in node field |user_id|. % % \begin{macrocode} --- cf. luatexref-t.pdf, sect. 8.1.4.25 @@ -472,18 +461,18 @@ local anonymous_whatsits = 0 local anonymous_prefix = "anon" % \end{macrocode} % -% The whatsit allocation is split into two functions: +% User whatsit allocation is split into two functions: % \verb|new_user_whatsit_id| registers a new id (an integer) % and returns it. It is up to the user what he actually does % with the return value. % -% Registering whatsits without a name, though supported, is +% Registering user whatsits without a name, though supported, is % not exactly good style. In these cases we generate a name % from a counter. % -% In addition to the whatsit name, it is possible and even +% In addition to the user whatsit name, it is possible and even % encouraged to specify the name of the package that will be -% using the whatsit as the second argument. +% using the user whatsit as the second argument. % % \begin{macrocode} --- string -> string -> int @@ -527,7 +516,7 @@ luatexbase.new_user_whatsit_id = new_user_whatsit_id % \end{macrocode} % % \verb|new_user_whatsit| first registers a new id and then also -% creates the corresponding whatsit of subtype “user defined”. +% creates the corresponding whatsit node of subtype “user-defined”. % We return a nullary function that delivers copies of the whatsit. % % \begin{macrocode} @@ -537,30 +526,13 @@ local new_user_whatsit = function (name, package) local whatsit = newnode(whatsit_t, user_defined_t) whatsit.user_id = id --- unit -> node_t - local generator = function (proto) - local res - if proto - and proto.id == whatsit_t - and proto.subtype == user_defined_t - then - local proto_id = proto.user_id - if proto_id ~= id then --- mismatch - warning("overriding user_id %d of whatsit prototype (now: %d)", - proto.user_id, id) - end - res = copynode(proto) - res.user_id = id - else - res = copynode(whatsit) - end - return res - end - return generator, id + return function ( ) return copynode(whatsit) end, id end luatexbase.new_user_whatsit = new_user_whatsit +luatexbase.new_user_whatsit_factory = new_user_whatsit --- for Stephan % \end{macrocode} % -% If one knows the name of a whatsit, its corresponding id +% If one knows the name of a user whatsit, its corresponding id % can be retrieved by means of \verb|get_user_whatsit_id|. % % \begin{macrocode} @@ -577,11 +549,11 @@ luatexbase.get_user_whatsit_id = get_user_whatsit_id % The inverse lookup is also possible via \verb|get_user_whatsit_name|. % Here it finally becomes obvious why it is beneficial to supply a package % name -- it adds information about who created and might be relying on the -% whatsit in question. First return value is the whatsit name, the second -% the package identifier it was registered with. +% user whatsit in question. First return value is the user whatsit name, the +% second the package identifier it was registered with. % -% We issue a warning and return empty strings in case the asked whatsit is -% unregistered. +% We issue a warning and return empty strings in case the argument +% doesn't correspond to a registered user whatsit id. % % \begin{macrocode} --- int | fun | node -> (string, string) diff --git a/luatexbase-cctb.dtx b/luatexbase-cctb.dtx index 1e95379..4b15776 100644 --- a/luatexbase-cctb.dtx +++ b/luatexbase-cctb.dtx @@ -109,7 +109,7 @@ See the aforementioned source file(s) for copyright and licensing information. % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \pkdate{luatexbase-cctb}{v0.4 2011-05-24} +% \pkdate{luatexbase-cctb}{v0.6 2013-05-11} % % \maketitle % @@ -325,7 +325,7 @@ See the aforementioned source file(s) for copyright and licensing information. \let\x\ProvidesPackage \fi \expandafter\endgroup -\x{luatexbase-cctb}[2011/05/24 v0.4 Catcodetable allocation for LuaTeX] +\x{luatexbase-cctb}[2013/05/11 v0.6 Catcodetable allocation for LuaTeX] % \end{macrocode} % % Make sure \luatex is used. @@ -356,15 +356,15 @@ See the aforementioned source file(s) for copyright and licensing information. % % \subsubsection{Load supporting Lua module} % -% First load \pk{luatexbase-loader} (hence \pk{luatexbase-compat}), then -% the supporting Lua module. +% First load \pk{luatexbase-modutils} (hence \pk{luatexbase-loader} +% and \pk{luatexbase-compat}), then the supporting Lua module. % % \begin{macrocode} \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname RequirePackage\endcsname\relax - \input luatexbase-loader.sty + \input luatexbase-modutils.sty \else - \RequirePackage{luatexbase-loader} + \RequirePackage{luatexbase-modutils} \fi \luatexbase@directlua{require('luatexbase.cctb')} % \end{macrocode} @@ -651,6 +651,15 @@ See the aforementioned source file(s) for copyright and licensing information. %<*luamodule> luatexbase = luatexbase or { } local luatexbase = luatexbase +luatexbase.provides_module({ + name = "luatexbase-cctb", + version = 0.6, + date = "2013/05/11", + description = "Catcodetable allocation for LuaTeX", + author = "Heiko Oberdiek, Elie Roux and Manuel Pegourie-Gonnard", + copyright = "Heiko Oberdiek, Elie Roux and Manuel Pegourie-Gonnard", + license = "CC0", +}) % \end{macrocode} % % The number associated to a CS name is remembered in the |catcodetables| diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx index 11918a3..c4bd008 100644 --- a/luatexbase-loader.dtx +++ b/luatexbase-loader.dtx @@ -112,7 +112,7 @@ See the aforementioned source file(s) for copyright and licensing information. % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \pkdate{luatexbase-loader}{v0.5 2013-04-13} +% \pkdate{luatexbase-loader}{v0.6 2013-05-11} % % \maketitle % @@ -208,7 +208,7 @@ See the aforementioned source file(s) for copyright and licensing information. \let\x\ProvidesPackage \fi \expandafter\endgroup -\x{luatexbase-loader}[2013/04/13 v0.5 Lua module loader for LuaTeX] +\x{luatexbase-loader}[2013/05/11 v0.6 Lua module loader for LuaTeX] % \end{macrocode} % % Make sure \luatex is used. diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx index 0c04d4d..b0ae1c9 100644 --- a/luatexbase-mcb.dtx +++ b/luatexbase-mcb.dtx @@ -115,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}{2013/04/13 v0.5} +% \pkdate{luatexbase-mcb}{2013/05/11 v0.6} % % \maketitle % @@ -332,7 +332,7 @@ See the aforementioned source file(s) for copyright and licensing information. \let\x\ProvidesPackage \fi \expandafter\endgroup -\x{luatexbase-mcb}[2013/04/13 v0.5 Callback management for LuaTeX] +\x{luatexbase-mcb}[2013/05/11 v0.6 Callback management for LuaTeX] % \end{macrocode} % % Make sure \luatex is used. @@ -363,8 +363,8 @@ See the aforementioned source file(s) for copyright and licensing information. % % \subsubsection{Load supporting Lua module} % -% First load \pk{luatexbase-loader} (hence \pk{luatexbase-compat}), then -% the supporting Lua module. +% First load \pk{luatexbase-modutils} (hence \pk{luatexbase-loader} +% and \pk{luatexbase-compat}), then the supporting Lua module. % % \begin{macrocode} \begingroup\expandafter\expandafter\expandafter\endgroup @@ -396,8 +396,8 @@ luatexbase = luatexbase or { } local luatexbase = luatexbase local err, warning, info, log = luatexbase.provides_module({ name = "luatexbase-mcb", - version = 0.5, - date = "2013/04/13", + version = 0.6, + date = "2013/05/11", description = "register several functions in a callback", author = "Hans Hagen, Elie Roux, Manuel Pegourie-Gonnard and Philipp Gesang", copyright = "Hans Hagen, Elie Roux, Manuel Pegourie-Gonnard and Philipp Gesang", diff --git a/luatexbase-modutils.dtx b/luatexbase-modutils.dtx index cd1458a..f411e46 100644 --- a/luatexbase-modutils.dtx +++ b/luatexbase-modutils.dtx @@ -111,7 +111,7 @@ See the aforementioned source file(s) for copyright and licensing information. % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \pkdate{luatexbase-modutils}{v0.6 2013-05-04} +% \pkdate{luatexbase-modutils}{v0.6 2013-05-11} % % \maketitle % @@ -343,7 +343,7 @@ See the aforementioned source file(s) for copyright and licensing information. \let\x\ProvidesPackage \fi \expandafter\endgroup -\x{luatexbase-modutils}[2013/04/13 v0.5 Module utilities for LuaTeX] +\x{luatexbase-modutils}[2013/05/11 v0.6 Module utilities for LuaTeX] % \end{macrocode} % % Make sure \luatex is used. @@ -685,6 +685,17 @@ end luatexbase.is_module_loaded = is_module_loaded % \end{macrocode} % +% We provide the module, for version checking. +% +% \begin{macrocode} +provides_module({ + name = 'luatexbase-modutils', + date = '2013/05/11', + version = 0.6, + description = 'Module utilities for LuaTeX', +}) +% \end{macrocode} +% % \begin{macrocode} %</luamodule> % \end{macrocode} diff --git a/luatexbase.dtx b/luatexbase.dtx index 2849818..f0ba25d 100644 --- a/luatexbase.dtx +++ b/luatexbase.dtx @@ -93,7 +93,7 @@ See the aforementioned source file(s) for copyright and licensing information. % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \pkdate{luatexbase}{v0.6 2013-05-04} +% \pkdate{luatexbase}{v0.6 2013-05-11} % % \maketitle % @@ -214,7 +214,7 @@ See the aforementioned source file(s) for copyright and licensing information. \let\x\ProvidesPackage \fi \expandafter\endgroup -\x{luatexbase}[2013/05/04 v0.6 Module utilities for LuaTeX] +\x{luatexbase}[2013/05/11 v0.6 Resource management for the LuaTeX macro programmer] % \end{macrocode} % % Make sure \luatex is used. @@ -264,20 +264,20 @@ See the aforementioned source file(s) for copyright and licensing information. \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname RequirePackage\endcsname\relax \input luatexbase-compat.sty + \input luatexbase-modutils.sty \input luatexbase-loader.sty \input luatexbase-regs.sty \input luatexbase-attr.sty \input luatexbase-cctb.sty \input luatexbase-mcb.sty - \input luatexbase-modutils.sty \else \RequirePackage{luatexbase-compat} + \RequirePackage{luatexbase-modutils} \RequirePackage{luatexbase-loader} \RequirePackage{luatexbase-regs} \RequirePackage{luatexbase-attr} \RequirePackage{luatexbase-cctb} \RequirePackage{luatexbase-mcb} - \RequirePackage{luatexbase-modutils} \fi % \end{macrocode} % |