diff options
| author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-05-23 18:20:29 +0200 | 
|---|---|---|
| committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-11-11 15:49:17 +0100 | 
| commit | ccf067d02062a1d45cefbbab158d6e4df1443dcc (patch) | |
| tree | 008a610c9faf371c3b039497a67c6be98620990b | |
| parent | afd6550bbe12c1593196d30df4a14d456cf3c6f7 (diff) | |
| download | luatexbase-ccf067d02062a1d45cefbbab158d6e4df1443dcc.tar.gz | |
Make use_module private.
| -rw-r--r-- | Changes | 10 | ||||
| -rw-r--r-- | TODO | 2 | ||||
| -rw-r--r-- | luatexbase-modutils.dtx | 19 | 
3 files changed, 20 insertions, 11 deletions
| @@ -1,5 +1,15 @@                      Changes in the luatexbase package/bundle + +(current changes) +    attr +        - Name changes: \*luatexattribute -> \*attribute. +    modutils +        - \luatexUseModule and \luatexRequireModule replaced by +          \RequireLuaModule with a unified syntax. +        - luatexbase.use_module removed (use luatexbase.require_module with +          a single argument instead). +  2010/10/04      various documentation updates/fixes uploaded to CTAN @@ -1,8 +1,8 @@  modutils  -------- -- syntax of public TeX macros and Lua functions  - create private functions for infwarrerr? +- use LaTeX style linebreaks in messages?  - review logic: should this module be mandatory?    if not, what should happen with mixed require(), require_module(), diff --git a/luatexbase-modutils.dtx b/luatexbase-modutils.dtx index 9e1ebb5..95e4611 100644 --- a/luatexbase-modutils.dtx +++ b/luatexbase-modutils.dtx @@ -169,14 +169,12 @@ See source file '\inFileName' for details.  %  % \subsection{Lua functions}  % -% The main functions are |luatexbase.require_module| and -% |luatexbase.use_module| which may be used as a replacement to |require()|. -% The only difference between these functions is, |require_module| accepts a -% second, optional argument in order to specify a minimal version. They do the -% same as |require()| but also make sure the module loaded correctly -% identifies itself with the name given, and its version is greater than the -% minimal version required. The version can be given either as a (floating -% point) number or as a date in YYYY/MM/DD format. +% The main function is |luatexbase.require_module| which may be used as a +% replacement to |require()|, but also checks that the module correctly +% identified itself, and accepts a second, optional argument containing +% version information to be checked against the similar information provided +% by the loaded module.  The version can be given either as a (floating point) +% number or as a date in YYYY/MM/DD format.  %  % Modules identify themselves using |luatexbase.provides_module|, whose only  % argument is a table with some information about the module. The mandatory @@ -466,7 +464,7 @@ local function warn(...) module_warning('luatexbase.modutils', ...) end  %    Load a module without version checking.  %  %    \begin{macrocode} -function use_module(name) +local function use_module(name)      require(name)      if not modules[name] then          warn("Module didn't properly identified itself: %s", name) @@ -479,7 +477,8 @@ end  %    \begin{macrocode}  function require_module(name, version)      if not version then -        return use_module(name) +        use_module(name) +        return      end      luaversion = parse_version(version)      if modules[name] then | 
