From 0e5d89e6d41c9fd2de8576ca0c98b9e295ab023a Mon Sep 17 00:00:00 2001 From: Stephan Hennig Date: Tue, 6 Nov 2012 20:00:01 +0100 Subject: Fix typos in luatexbase-attr documentation. --- luatexbase-attr.dtx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx index 923ad97..54ff8b5 100644 --- a/luatexbase-attr.dtx +++ b/luatexbase-attr.dtx @@ -145,7 +145,7 @@ See the aforementioned source file(s) for copyright and licensing information. % number of the attribute associated to |\fooattr| assuming it was defined % using |\newluatexattribute\fooattr|, something that \luatex currently % doesn't support (you can get the current value of the associated attribute -% as |tex.atrribute.fooattr|, but not the attribute number). +% as |tex.attribute.fooattr|, but not the attribute number). % % There are several ways to work around this. For example, it is possible to % extract the number at any time from the |\meaning| of |\fooattr|. @@ -158,7 +158,7 @@ See the aforementioned source file(s) for copyright and licensing information. % % Also, two Lua functions are provided that are analogous to the above \tex % macros (actually, the macros are wrappers around the functions): -% |luatexbase.new_attributes|\parg{name} allocates a new attribute, without +% |luatexbase.new_attribute|\parg{name} allocates a new attribute, without % defining a corresponding \tex control sequence (only an entry in % |luatexbase.attributes| is created. It usually returns the number of the % allocated attribute. If room is missing, it raises an error, unless the -- cgit v1.2.3 From 522ac06e50f8155af51423a13cb6d06020b02443 Mon Sep 17 00:00:00 2001 From: Stephan Hennig Date: Tue, 6 Nov 2012 20:00:02 +0100 Subject: Fix typos in luatexbase-mcb documentation. --- luatexbase-mcb.dtx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx index b26f56f..6f1b1a6 100644 --- a/luatexbase-mcb.dtx +++ b/luatexbase-mcb.dtx @@ -141,7 +141,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 +156,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 +166,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. -- cgit v1.2.3 From c554ada26ffc925e520a5fb026272065a3671ff7 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sun, 7 Apr 2013 19:28:51 +0200 Subject: Fixing package loading for LuaTeX > 0.74 Starting from LuaTeX 0.74, Lua 5.2 is used, and packages.loaders is renamed into packages.searchers, which makes luatexbase and thus almost all LuaLaTeX packages broken. This commit fixes it, keeping backward compatibility. --- luatexbase-loader.dtx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx index 3bf1b47..92e97b2 100644 --- a/luatexbase-loader.dtx +++ b/luatexbase-loader.dtx @@ -374,10 +374,16 @@ end % \end{macrocode} % % Combined searcher, using primarily the new kpse searcher, and the -% original as a fall-back. +% original as a fall-back. Starting from \luatex 0.75, Lua 5.2 is used. Among +% the changes, |package.loaders| is renamed as |package.searchers|. % % \begin{macrocode} -local package_loader_two = package.loaders[2] +local package_loader_two +if package.searchers then + package_loader_two = package.searchers[2] +else + package_loader_two = package.loaders[2] +end local function load_module(mod) local file = find_module_file(mod) if not file then @@ -403,7 +409,11 @@ end % Finally install this combined loader as loader 2. % % \begin{macrocode} -package.loaders[2] = load_module +if package.searchers then + package.searchers[2] = load_module +else + package.loaders[2] = load_module +end % % \end{macrocode} % -- cgit v1.2.3 From e1235674abdd5cf891f169e30683fddbfcb87af1 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 9 Apr 2013 18:31:29 +0200 Subject: Fixing bug by making optional argument optional --- luatexbase-modutils.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luatexbase-modutils.dtx b/luatexbase-modutils.dtx index 2dce051..1e511d5 100644 --- a/luatexbase-modutils.dtx +++ b/luatexbase-modutils.dtx @@ -552,7 +552,7 @@ function require_module(name, req_date) local info = modules[name] if not info then warn("module '%s' was not properly identified", name) - elseif info.version then + elseif req_date and info.version then if not (info.date and date_to_int(info.date) > date_to_int(req_date)) then warn("module '%s' required in version '%s'\n" -- cgit v1.2.3 From 2617aa3572939fa4585640f85e3b2b8835827b97 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 11 Apr 2013 23:06:32 +0200 Subject: update mcb.lua for 5.2 --- Makefile | 2 +- luatexbase-mcb.dtx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0f65bf1..188d1e4 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ luatexbase.%.lua: %.lua $(UNPACKED_MCB): luatexbase-mcb.dtx $(DO_TEX) - echo \\\\relax > $(TEST_MCB) + echo \\relax > $(TEST_MCB) $(UNPACKED_REGS): luatexbase-regs.dtx $(DO_TEX) diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx index b26f56f..e292b50 100644 --- a/luatexbase-mcb.dtx +++ b/luatexbase-mcb.dtx @@ -733,7 +733,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) -- cgit v1.2.3 From 37823d6e677ae4048a9f6e6fc69d49cb2c9b53ad Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 12 Apr 2013 09:34:58 +0200 Subject: Adapting to Lua 5.2 a better way --- luatexbase-loader.dtx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx index 92e97b2..b7d3a5f 100644 --- a/luatexbase-loader.dtx +++ b/luatexbase-loader.dtx @@ -379,11 +379,10 @@ end % % \begin{macrocode} local package_loader_two -if package.searchers then - package_loader_two = package.searchers[2] -else - package_loader_two = package.loaders[2] +if not package.searchers then + package.searchers = package.loaders end +package_loader_two = package.searchers[2] local function load_module(mod) local file = find_module_file(mod) if not file then @@ -409,11 +408,7 @@ end % Finally install this combined loader as loader 2. % % \begin{macrocode} -if package.searchers then - package.searchers[2] = load_module -else - package.loaders[2] = load_module -end +package.searchers[2] = load_module % % \end{macrocode} % -- cgit v1.2.3 From 070f0ab10bddad9db9128c72d4c13c1d93a17802 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 12 Apr 2013 11:18:36 +0200 Subject: Makefile now compatible with GNU Make 3.81 and 3.82 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 188d1e4..8f2f30d 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ luatexbase.%.lua: %.lua $(UNPACKED_MCB): luatexbase-mcb.dtx $(DO_TEX) - echo \\relax > $(TEST_MCB) + echo "\\\relax" > $(TEST_MCB) $(UNPACKED_REGS): luatexbase-regs.dtx $(DO_TEX) -- cgit v1.2.3 From a54a5447140eba0e9bf842578be2f7724a165a44 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 12 Apr 2013 18:14:29 +0200 Subject: Fixing something silly This part seems highly untested and raw... in pcall you have to call a function, not a string.. --- luatexbase-loader.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx index b7d3a5f..2635c54 100644 --- a/luatexbase-loader.dtx +++ b/luatexbase-loader.dtx @@ -353,7 +353,7 @@ end % % \begin{macrocode} local find_file_lua -if pcall('kpse.find_file', 'dummy', 'lua') then +if pcall(kpse.find_file, 'dummy', 'lua') then find_file_lua = function (name) return kpse.find_file(name, 'lua') or find_file_lua_emul(name) end -- cgit v1.2.3 From 66fbe5c895b191027d609edc2fef9f4888049236 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 12 Apr 2013 19:50:12 +0200 Subject: Fixing many issues and breaking compatibility with LuaTeX < 0.45 (TeXLive 2009) There were several bugs in there (especially when the file asked ends by '.lua'), but seems ok now. Most of the old code has been removed, as the documentation said the next version would be only compatible with LuaTeX >= 0.45. --- luatexbase.dtx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/luatexbase.dtx b/luatexbase.dtx index b962f30..f7a754a 100644 --- a/luatexbase.dtx +++ b/luatexbase.dtx @@ -126,9 +126,8 @@ See the aforementioned source file(s) for copyright and licensing information. % change should happen in the future, except the removal of the deprecated % commands (currently only \cs{setcatcoderange}). It works with the Plain and % \latex formats adapted for \luatex as provided by \texlive and MiK\tex. -% Currently the oldest version supported is 0.25.4 with formats from \texlive -% 2008; the next release of this package will only support 0.40.6 and greater -% with formats from \texlive 2009 and greater. +% Currently the oldest version supported is 0.40.6 with formats from +% \texlive 2009 and greater. % % \subsection{History} % -- cgit v1.2.3 From e38806bf8bff581003f3681b79d971d520f212c6 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Fri, 12 Apr 2013 19:52:54 +0200 Subject: Fixing many issues and breaking compatibility with LuaTeX < 0.45 (TeXLive 2009) --- luatexbase-loader.dtx | 102 ++++++++++++++------------------------------------ 1 file changed, 28 insertions(+), 74 deletions(-) diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx index 2635c54..5550fdf 100644 --- a/luatexbase-loader.dtx +++ b/luatexbase-loader.dtx @@ -133,27 +133,22 @@ See the aforementioned source file(s) for copyright and licensing information. % when the library is initialised (which is always the case in \tex mode, % unless explicitly disabled by the user). However, it did not respect the % Lua convention that |require("foo.bar")| should look for |foo/bar.lua| until -% version 0.60. This package adds such behaviour to older versions of \luatex. -% -% More precisely, it implements a new kpse searcher that looks for file -% |foo/bar| using Kpathsea with the format |lua| (that is, search along -% |LUAINPUTS| and try the following extensions: |.luc|, |.luctex|, |.texluc|, -% |.lua|, |.luatex|, |.texlua|). If this search fails, it falls back to -% |foo.bar| (along the same path with the same extensions). -% -% Also, older versions of \luatex, such as 0.25.4 (\texlive 2008), don't know -% about the |lua| format for kpse searching. So, an emulator for this function -% is provided. The emulator is not perfect, in particular it may find more -% results than the normal |lua| format search.\footnote{And may also fail to -% find the file in particular cases, see comments in the implementation for -% details.} In order to ensure more homogeneous results across versions, this -% emulator is used as a fall-back when the real |lua| format search doesn't -% find any result. -% -% Finally, a combined version of this new kpse searcher and the original -% function at |package.loaders[2]| (using first the new loader, then the old -% one if the new doesn't return any result) is installed as -% |package.loaders[2]|. +% version 0.60. \luatex 0.74 ships with Lua 5.2 that has a different loading +% system. +% +% The aim of this package is to have a coherent behaviour between versions of +% LuaTeX. The first versions did ensure backward compatibilty to \luatex 0.25 +% but as \luatex development is quite fast, this version supports only \luatex +% 0.45 and higher. +% +% More precisely, when asked for |foo.bar| (or |foo.bar.lua|), it first looks +% for file |foo/bar| using Kpathsea with the format |lua|, and then for +% |foo.bar|. +% +% As |oberdiek.luatex.lua| from |luatex.sty| also registers a loader, we +% make a combined version of the new kpse searcher of this package and the +% function registered in |oberdiek.luatex.lua| (registered in +% |package.searchers[2]|) and register it in |package.searchers[2]|. % % \section{Implementation} % @@ -266,7 +261,7 @@ See the aforementioned source file(s) for copyright and licensing information. % \begin{macrocode} \luatexbase@directlua{% local file = "luatexbase.loader.lua" - local path = assert(kpse.find_file(file, 'tex'), + local path = assert(kpse.find_file(file, 'lua'), "File '"..file.."' not found") texio.write_nl("("..path..")") dofile(path)} @@ -291,8 +286,7 @@ module('luatexbase', package.seeall) % approximate |LUAINPUTS|. But we need to handle suffixes ourselves. % % |lua_suffixes| is taken verbatim from Kpathsea's source -% (\file{tex-file.c}, constant |LUA_SUFFIXES|).\footnote{Unchanged since -% 2007-07-06, last checked 2010-05-10.} +% (\file{tex-file.c}, constant |LUA_SUFFIXES|).\footnote{Last checked 2013-04-12.} % % \begin{macrocode} local lua_suffixes = { @@ -308,68 +302,28 @@ local function ends_with(suffix, name) end % \end{macrocode} % -% The search function first builds the list of filenames to be search. For -% the lua format, kpse always adds a suffix if no (known) suffix is -% present, so we do the same. +% Auxiliary function for suffixes: returns the basename of a file if it end +% by one of the suffixes. % % \begin{macrocode} -local function find_file_lua_emul(name) - local search_list = {} +local function basename(name) for _, suffix in ipairs(lua_suffixes) do if ends_with(suffix, name) then - search_list = { name } - break - else - table.insert(search_list, name..suffix) - end - end -% \end{macrocode} -% -% Now look for each file in this list. -% -% \begin{macrocode} - for _, search_name in ipairs(search_list) do - local f = kpse.find_file(search_name, 'texmfscripts') - or kpse.find_file(search_name, 'tex') -% \end{macrocode} -% -% There is a problem with using the |tex| search format: kpse will try to -% add suffixes from the |TEX_SUFFIXES| list, which may lead to problems -% if a file like \meta{name}|.lua.tex| exists. We prevent that by checking if -% the file found ends with the required name. So \meta{name}|.lua| will -% still be hidden by \meta{name}.|lua.tex| but it seems less bad not to -% find it than to return an incorrect result. -% -% \begin{macrocode} - if f and ends_with(search_name, f) then - return f + return name:sub(1, -(suffix:len()+1)) end end + return name end % \end{macrocode} % -% If lua search format is available, use it with emulation as a fall-back, -% or just use emulation. -% -% \begin{macrocode} -local find_file_lua -if pcall(kpse.find_file, 'dummy', 'lua') then - find_file_lua = function (name) - return kpse.find_file(name, 'lua') or find_file_lua_emul(name) - end -else - find_file_lua = function (name) - return find_file_lua_emul(name) - end -end -% \end{macrocode} -% -% Find the full path corresponding to a module name. +% The main function. Currently it emulates the behaviour |x.y->x/y.lua| +% for compatibility with \luatex prior to 0.60, but this behaviour +% should be considered deprecated and will disapear in the next release. % % \begin{macrocode} local function find_module_file(mod) - return find_file_lua(mod:gsub('%.', '/'), 'lua') - or find_file_lua(mod, 'lua') + local compat = basename(mod):gsub('%.', '/') + return kpse.find_file(compat, 'lua') or kpse.find_file(mod, 'lua') end % \end{macrocode} % -- cgit v1.2.3 From 686e9f8c4d187561f5500d341d88280189f89684 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 13 Apr 2013 15:16:00 +0200 Subject: Fixing documentation and very small improvement --- luatexbase-loader.dtx | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx index 5550fdf..5471fd7 100644 --- a/luatexbase-loader.dtx +++ b/luatexbase-loader.dtx @@ -114,7 +114,7 @@ See the aforementioned source file(s) for copyright and licensing information. % % \pkdate{luatexbase-loader}{v0.4 2011-05-24} % -% \maketitle +% \maketitle % % \begin{abstract} % Lua modules are loaded using the |require()| function which, similarly to @@ -137,18 +137,14 @@ See the aforementioned source file(s) for copyright and licensing information. % system. % % The aim of this package is to have a coherent behaviour between versions of -% LuaTeX. The first versions did ensure backward compatibilty to \luatex 0.25 +% LuaTeX, and to get the loaded file's name printed in the output (\LaTeX +% style). The first versions did ensure backward compatibilty to \luatex 0.25 % but as \luatex development is quite fast, this version supports only \luatex % 0.45 and higher. % % More precisely, when asked for |foo.bar| (or |foo.bar.lua|), it first looks % for file |foo/bar| using Kpathsea with the format |lua|, and then for -% |foo.bar|. -% -% As |oberdiek.luatex.lua| from |luatex.sty| also registers a loader, we -% make a combined version of the new kpse searcher of this package and the -% function registered in |oberdiek.luatex.lua| (registered in -% |package.searchers[2]|) and register it in |package.searchers[2]|. +% |foo.bar|, removing the possible extension. % % \section{Implementation} % @@ -281,6 +277,12 @@ See the aforementioned source file(s) for copyright and licensing information. module('luatexbase', package.seeall) % \end{macrocode} % +% Just in case it's called from a \TeX Lua script... +% +% \begin{macrocode} +kpse.set_program_name("luatex") +% \end{macrocode} +% % Emulate (approximatively) kpse's lua format search. More precisely, % combine the search path of |texmfscripts| and |tex| in order to % approximate |LUAINPUTS|. But we need to handle suffixes ourselves. @@ -316,9 +318,8 @@ local function basename(name) end % \end{macrocode} % -% The main function. Currently it emulates the behaviour |x.y->x/y.lua| -% for compatibility with \luatex prior to 0.60, but this behaviour -% should be considered deprecated and will disapear in the next release. +% The main function, emulating the behaviour of |packages.searchers[2]|, +% with a small improvement that eliminates the possible extension. % % \begin{macrocode} local function find_module_file(mod) @@ -328,9 +329,11 @@ end % \end{macrocode} % % Combined searcher, using primarily the new kpse searcher, and the -% original as a fall-back. Starting from \luatex 0.75, Lua 5.2 is used. Among +% original as a fall-back. Starting from \luatex 0.75, Lua 5.2 is used. Among % the changes, |package.loaders| is renamed as |package.searchers|. % +% The main improvement is thus the printing of the filename in the output. +% % \begin{macrocode} local package_loader_two if not package.searchers then -- cgit v1.2.3 From 16d3c6150b75ec6676b773b215009f6f08cab151 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 13 Apr 2013 16:11:57 +0200 Subject: Bumping version --- Changes | 10 ++++++++++ luatexbase-loader.dtx | 6 +++--- luatexbase.dtx | 6 +++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index 10a79e6..e3a7959 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,15 @@ Changes in the luatexbase package/bundle +2013/04/13 v0.5 + mcb and loader + - compatibility with Lua 5.2 (LuaTeX >= 0.74) + loader + - fix an important bug making the kpse lua loader never used, + it should make package searching a bit faster. + - dropping support for LuaTeX < 0.45. + - small improvement to make x.y.lua look for x/y.lua, not + x/y/lua. + 2011/00/24 v0.4 cctb - implement catcode table stacks à la luatex.sty diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx index 5471fd7..77b9b9b 100644 --- a/luatexbase-loader.dtx +++ b/luatexbase-loader.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 2009, 2010 by Élie Roux +% Copyright 2009-2013 by Élie Roux % Copyright 2010, 2011 by Manuel Pégourié-Gonnard % % This work is under the CC0 license. @@ -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.4 2011-05-24} +% \pkdate{luatexbase-loader}{v0.5 2013-04-13} % % \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}[2011/05/24 v0.4 Lua module loader for LuaTeX] +\x{luatexbase-loader}[2013/04/13 v0.5 Lua module loader for LuaTeX] % \end{macrocode} % % Make sure \luatex is used. diff --git a/luatexbase.dtx b/luatexbase.dtx index f7a754a..6bf3fa6 100644 --- a/luatexbase.dtx +++ b/luatexbase.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 2009, 2010 by Élie Roux +% Copyright 2009-2013 by Élie Roux % Copyright 2010, 2011 by Manuel Pégourié-Gonnard % % This work is under the CC0 license. @@ -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.4 2011-05-24} +% \pkdate{luatexbase}{v0.5 2013-04-13} % % \maketitle % @@ -214,7 +214,7 @@ See the aforementioned source file(s) for copyright and licensing information. \let\x\ProvidesPackage \fi \expandafter\endgroup -\x{luatexbase}[2011/05/24 v0.4 Module utilities for LuaTeX] +\x{luatexbase}[2013/04/13 v0.5 Module utilities for LuaTeX] % \end{macrocode} % % Make sure \luatex is used. -- cgit v1.2.3 From f998fe177acb83497677679122a7e3e60d29b7b5 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 13 Apr 2013 16:27:52 +0200 Subject: Bumping version --- luatexbase-mcb.dtx | 13 +++++++------ luatexbase-modutils.dtx | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx index e292b50..8b99a52 100644 --- a/luatexbase-mcb.dtx +++ b/luatexbase-mcb.dtx @@ -2,6 +2,7 @@ % % Copyright 2009, 2010 by Élie Roux % Copyright 2010, 2011 by Manuel Pégourié-Gonnard +% Copyright 2013 by Philipp Gesang % % 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 % @@ -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. @@ -394,11 +395,11 @@ See the aforementioned source file(s) for copyright and licensing information. module('luatexbase', package.seeall) local err, warning, info = 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} diff --git a/luatexbase-modutils.dtx b/luatexbase-modutils.dtx index 1e511d5..57ffb1d 100644 --- a/luatexbase-modutils.dtx +++ b/luatexbase-modutils.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 2009, 2010 by Élie Roux +% Copyright 2009-2013 by Élie Roux % Copyright 2010, 2011 by Manuel Pégourié-Gonnard % % This work is under the CC0 license. @@ -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.4 2011-05-24} +% \pkdate{luatexbase-modutils}{v0.5 2013-04-13} % % \maketitle % @@ -345,7 +345,7 @@ See the aforementioned source file(s) for copyright and licensing information. \let\x\ProvidesPackage \fi \expandafter\endgroup -\x{luatexbase-modutils}[2011/05/24 v0.4 Module utilities for LuaTeX] +\x{luatexbase-modutils}[2013/04/13 v0.5 Module utilities for LuaTeX] % \end{macrocode} % % Make sure \luatex is used. -- cgit v1.2.3 From 2f229562fad26352a346f846d23d803818581197 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 16 Apr 2013 04:44:22 +0200 Subject: begin attribute allocation at 255 luaotfload will allocate attributes from 127 but never exceed 254. This patch prevents attribute clashes by offsetting the allocation of new attributes by 255. --- luatexbase-attr.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx index 923ad97..86470b2 100644 --- a/luatexbase-attr.dtx +++ b/luatexbase-attr.dtx @@ -357,7 +357,7 @@ attributes = {} % doesn't seem bad to ``loose'' one item in order to avoid this problem. % % \begin{macrocode} -local last_alloc = 0 +local last_alloc = 255 function new_attribute(name, silent) if last_alloc >= 65535 then if silent then -- cgit v1.2.3 From 0fa82d952c1fc02c56e38c6e3a3e023f85cd5d79 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 11:15:18 +0200 Subject: Not including luatex.sty in the CTAN archive --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8f2f30d..6fdc7fb 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Makefile for luatexbase NAME = luatexbase -DTX = $(wildcard *.dtx) +DTX = $(wildcard luatexbase*.dtx) DOC = $(patsubst %.dtx, %.pdf, $(DTX)) DTXSTY = lltxb-dtxstyle.tex @@ -28,6 +28,9 @@ UNPACKED_LUATEX = luatex.sty test-luatex1.tex test-luatex2.tex \ UNPACKED = $(UNPACKED_MCB) $(UNPACKED_REGS) $(UNPACKED_ATTR) $(UNPACKED_CCTB) \ $(UNPACKED_LOADER) $(UNPACKED_MODUTILS) $(UNPACKED_COMPAT) \ $(UNPACKED_BASE) $(UNPACKED_LUATEX) +UNPACKEDTL = $(UNPACKED_MCB) $(UNPACKED_REGS) $(UNPACKED_ATTR) $(UNPACKED_CCTB) \ + $(UNPACKED_LOADER) $(UNPACKED_MODUTILS) $(UNPACKED_COMPAT) \ + $(UNPACKED_BASE) COMPILED = $(DOC) GENERATED = $(COMPILED) $(UNPACKED) SOURCE = $(DTX) $(DTXSTY) README TODO Changes Makefile @@ -38,8 +41,8 @@ TMP_LOADER = $(TEST_LOADER).tex TEST_MCB = test-mcb-aux.tex # Files grouped by installation location -RUNFILES = $(filter-out test-%, $(UNPACKED)) -DOCFILES = $(DOC) $(filter test-%, $(UNPACKED)) README TODO Changes +RUNFILES = $(filter-out test-%, $(UNPACKEDTL)) +DOCFILES = $(DOC) $(filter test-%, $(UNPACKEDTL)) README TODO Changes SRCFILES = $(DTX) Makefile # The following definitions should be equivalent -- cgit v1.2.3 From 6732b8712a1ab2a6cd750bf97ed98103a854bd53 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 11:16:13 +0200 Subject: Inputing luatex.sty before luatexbase Otherwise luatex.sty breaks --- Changes | 3 +++ luatexbase.dtx | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index e3a7959..0b6b3d4 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,9 @@ Changes in the luatexbase package/bundle 2013/04/13 v0.5 + all + - input luatex.sty before doing anything, is luatex.sty + breaks if loaded after luatexbase mcb and loader - compatibility with Lua 5.2 (LuaTeX >= 0.74) loader diff --git a/luatexbase.dtx b/luatexbase.dtx index 6bf3fa6..49b0c07 100644 --- a/luatexbase.dtx +++ b/luatexbase.dtx @@ -132,11 +132,11 @@ See the aforementioned source file(s) for copyright and licensing information. % \subsection{History} % % The first package for managing \luatex's new resources was the \pk{luatex} -% package by Heiko Oberdiek. Later, Élie Roux wrote \pk{luatextra} which +% package by Heiko Oberdiek. Later, \'Elie Roux wrote \pk{luatextra} which % reprised many features of \pk{luatex} with little extensions to some of them % and added independant low-level features (currently found in the % \pk{modutils} and \pk{mcb} subpackages), as well as user-level things. -% Later, \pk{luatexbase} was created by Manuel Pégourié-Gonnard by isolating +% Later, \pk{luatexbase} was created by Manuel P\'egouri\'e-Gonnard by isolating % the general low-level features of \pk{luatextra}, and later expanding on % them. % @@ -243,6 +243,21 @@ See the aforementioned source file(s) for copyright and licensing information. \fi % \end{macrocode} % +% %\subsection{luatex.sty compatibility} +% +% Currently, |luatex.sty| has to be loaded before luatexbase, otherwise it +% raises an error, as the same names are used between luatexbase and luatex. +% +% This is a quite strange situation, but we hope to clarify it. +% +% \begin{macrocode} +\expandafter\ifx\csname RequirePackage\endcsname\relax + \input luatex.sty +\else + \RequirePackage{luatex} +\fi +% \end{macrocode} +% % \subsection{Packages loading} % % \begin{macrocode} -- cgit v1.2.3 From a2ee5bc3b3ebe670d234826aa4302944ac301142 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 11:16:58 +0200 Subject: Removing utf8 characters For an unknown reason, it breaks on my system... --- lltxb-dtxstyle.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lltxb-dtxstyle.tex b/lltxb-dtxstyle.tex index 804dbfb..115d4f2 100644 --- a/lltxb-dtxstyle.tex +++ b/lltxb-dtxstyle.tex @@ -57,8 +57,8 @@ \newif\ifluatexbase \author{% Heiko Oberdiek (primary author of \pk{luatex}) \\ - Élie Roux (primary author of \pk{luatextra}) \\ - Manuel Pégourié-Gonnard (current developper)\thanks{% + \'Elie Roux (primary author of \pk{luatextra}) \\ + Manuel P\'egouri\'e-Gonnard (current developper)\thanks{% See ``History'' \ifluatexbase\else in \href{luatexbase.pdf}{\file{luatexbase.pdf}} \fi for details.}% @@ -68,7 +68,7 @@ } \hypersetup{% pdfsubject = {Basic resource management for LuaTeX}, - pdfauthor = {Manuel Pégourié-Gonnard, Élie Roux, Heiko Oberdiek}, + pdfauthor = {Manuel P\'egouri\'e-Gonnard, \'Elie Roux, Heiko Oberdiek}, } % other metadata -- cgit v1.2.3 From f561b20dfd29458a3e0cd3d73d47cb491e9642f8 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 11:24:56 +0200 Subject: Updating TODO --- TODO | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/TODO b/TODO index b70a84a..6205464 100644 --- a/TODO +++ b/TODO @@ -13,9 +13,7 @@ all or generalise use of qstest - add debug messages to be used in the test suite? - mark all occurences of version-dependent stuff in the code -- drop compat for 0.25 when tl2010 is frozen -- quit using module() in favor of locals, more generally ensure compat with - Lua 5.2 +- quit using module() in favor of locals - support the syntax foo = require"foo" in modutils? How? compat -- cgit v1.2.3 From 5e54c556e848afd081f6d47cb45bc5d7e192c30d Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 11:34:46 +0200 Subject: Fixing a typo --- Changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changes b/Changes index 0b6b3d4..c4a11e5 100644 --- a/Changes +++ b/Changes @@ -2,7 +2,7 @@ 2013/04/13 v0.5 all - - input luatex.sty before doing anything, is luatex.sty + - input luatex.sty before doing anything, as luatex.sty breaks if loaded after luatexbase mcb and loader - compatibility with Lua 5.2 (LuaTeX >= 0.74) -- cgit v1.2.3 From e6bd7d618a4bad71f90cfa111cd56197eb366d13 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 16 Apr 2013 11:48:53 +0200 Subject: add note to doc about attribute handling --- luatexbase-attr.dtx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx index 86470b2..a3b2e46 100644 --- a/luatexbase-attr.dtx +++ b/luatexbase-attr.dtx @@ -351,10 +351,11 @@ module('luatexbase', package.seeall) attributes = {} % \end{macrocode} % -% The allocaton function. Unlike other registers, allocate starting from 1. -% Some code (eg, font handling coming from Con\tex{}t) behaves strangely -% with \verb+\attribute0+ and since there is plenty of room here, it -% doesn't seem bad to ``loose'' one item in order to avoid this problem. +% The allocation function. Unlike other registers, allocate starting from 255. +% Some code (e.g., font handling coming from Con\tex{}t) behaves strangely +% with \verb+\attribute0+. What is more the font loader allocates its own +% attributes in the range from 127 to 254. Since there is plenty of room +% here, it doesn't seem bad to skep a few items in order to avoid clashes. % % \begin{macrocode} local last_alloc = 255 -- cgit v1.2.3 From 16c1318272c3fd2451cf7a3f5f93af1973131270 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 12:17:59 +0200 Subject: Fixing a bug with plain tex --- luatexbase-modutils.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luatexbase-modutils.dtx b/luatexbase-modutils.dtx index 57ffb1d..ae228b4 100644 --- a/luatexbase-modutils.dtx +++ b/luatexbase-modutils.dtx @@ -378,7 +378,7 @@ See the aforementioned source file(s) for copyright and licensing information. % supporting Lua module and make sure |luaescapestring| is available. % % \begin{macrocode} -\ifdefined\RequirePackage +\ifx\csname\RequirePackage \RequirePackage{luatexbase-loader} \else \input luatexbase-loader.sty -- cgit v1.2.3 From fb079cebe47137b48aa90ad735075d657695239a Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 12:19:28 +0200 Subject: A better fix --- luatexbase-modutils.dtx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/luatexbase-modutils.dtx b/luatexbase-modutils.dtx index ae228b4..6f500da 100644 --- a/luatexbase-modutils.dtx +++ b/luatexbase-modutils.dtx @@ -378,10 +378,10 @@ See the aforementioned source file(s) for copyright and licensing information. % supporting Lua module and make sure |luaescapestring| is available. % % \begin{macrocode} -\ifx\csname\RequirePackage - \RequirePackage{luatexbase-loader} -\else +\expandafter\ifx\csname RequirePackage\endcsname\relax \input luatexbase-loader.sty +\else + \RequirePackage{luatexbase-loader} \fi \luatexbase@directlua{require('luatexbase.modutils')} \luatexbase@ensure@primitive{luaescapestring} -- cgit v1.2.3 From 3598f72232426c45f81165df60211b65a2bbcf8a Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Tue, 16 Apr 2013 12:21:37 +0200 Subject: Update Changes --- Changes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changes b/Changes index c4a11e5..7689400 100644 --- a/Changes +++ b/Changes @@ -12,6 +12,9 @@ - dropping support for LuaTeX < 0.45. - small improvement to make x.y.lua look for x/y.lua, not x/y/lua. + modutils + - fixing a bug printing "luatexbase-attr" in all documents + in plain TeX 2011/00/24 v0.4 cctb -- cgit v1.2.3 From 83d1a96aab50cc552604357dedc0b4810914c31a Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Mon, 22 Apr 2013 14:41:35 +0200 Subject: Filenames are not printed if called by texlua --- luatexbase-loader.dtx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx index 77b9b9b..b8e5098 100644 --- a/luatexbase-loader.dtx +++ b/luatexbase-loader.dtx @@ -283,6 +283,17 @@ module('luatexbase', package.seeall) kpse.set_program_name("luatex") % \end{macrocode} % +% In \LaTeX, it's traditional to print the included file paths. We don't want +% to do this for scripts using texlua... Currently there is no perfect check +% of texlua vs. luatex, so we check for the token table. +% +% \begin{macrocode} +local print_included_path = false +if token then + print_included_path = true +end +% \end{macrocode} +% % Emulate (approximatively) kpse's lua format search. More precisely, % combine the search path of |texmfscripts| and |tex| in order to % approximate |LUAINPUTS|. But we need to handle suffixes ourselves. @@ -357,7 +368,9 @@ local function load_module(mod) if not loader then return "\n\t[luatexbase.loader] Loading error:\n\t"..error end - texio.write_nl("("..file..")") + if print_included_path then + texio.write_nl("("..file..")") + end return loader end % \end{macrocode} -- cgit v1.2.3 From 6d08e81d1de5033c7edefcce80656bda175aef08 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Mon, 22 Apr 2013 14:42:43 +0200 Subject: Callback infos are now in the log files I'm not sure these are meaningfull for users... --- luatexbase-mcb.dtx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx index 8b99a52..ee07019 100644 --- a/luatexbase-mcb.dtx +++ b/luatexbase-mcb.dtx @@ -393,7 +393,7 @@ 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.5, date = "2013/04/13", @@ -687,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} @@ -733,7 +733,7 @@ function remove_from_callback (name, description) return end table.remove(l, index) - info("removing '%s'\nfrom '%s'", description, name) + log("removing '%s'\nfrom '%s'", description, name) if #l == 0 then callbacklist[name] = nil if not lua_callbacks_defaults[name] then @@ -756,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) @@ -823,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 -- cgit v1.2.3 From 9f6a0549cd37e642e4e3fd6c31a210544b6e93a0 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Mon, 22 Apr 2013 15:03:46 +0200 Subject: Updating Changes --- Changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Changes b/Changes index 7689400..7b39c55 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ Changes in the luatexbase package/bundle +2013/04/22 v0.6 + loader + - do not output included file paths when called by texlua + mcb + - passing most of the term output to the log + 2013/04/13 v0.5 all - input luatex.sty before doing anything, as luatex.sty -- cgit v1.2.3 From b4e1f1e6c19a0784f88fd2696f976e190e3614e3 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sat, 27 Apr 2013 17:09:42 +0200 Subject: Hack to make newattributes work in cooperation with the oberdiek bundle --- luatex.dtx | 8 ++++++++ luatexbase-attr.dtx | 28 +++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/luatex.dtx b/luatex.dtx index 2830f0d..699aee5 100644 --- a/luatex.dtx +++ b/luatex.dtx @@ -227,6 +227,14 @@ See the aforementioned source file(s) for copyright and licensing information. \fi % \end{macrocode} % +% We set |LuT@AllocAttribute| in order for the hacks in luatexbase-attr to +% work. +% +% \begin{macrocode} +\newcount\LuT@AllocAttribute +\LuT@AllocAttribute=\m@ne +% \end{macrocode} +% % \subsection{Packages loading} % % \begin{macrocode} diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx index 923ad97..afbb102 100644 --- a/luatexbase-attr.dtx +++ b/luatexbase-attr.dtx @@ -283,14 +283,16 @@ 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. +% the supporting Lua module. We make sure 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} @@ -351,6 +353,23 @@ module('luatexbase', package.seeall) attributes = {} % \end{macrocode} % +% There are currently two functions that create a new attribute.One is in +% |oberdiek| bundle, the other is this one. We will hack a little in order +% to make them compatible. The other function uses |LuT@AllocAttribute| as +% attribute counter, we will keep it in sync with ours. A possible problem +% might also appear: the other function starts attribute allocation at 0, +% which might break luaotfload. We output an error if a new attribute has +% already been allocated with number 0. +% +% \begin{macrocode} +local luatex_sty_counter = 'LuT@AllocAttribute' +if tex.count[luatex_sty_counter] and tex.count[luatex_sty_counter] > -1 then + error("luatexbase error: attribute 0 has already been set by \newattribute" + .."macro from luatex.sty, not belonging to this package, this makes" + .."luaotfload unuseable. Please report to the maintainer of luatex.sty") +end +% \end{macrocode} +% % The allocaton function. Unlike other registers, allocate starting from 1. % Some code (eg, font handling coming from Con\tex{}t) behaves strangely % with \verb+\attribute0+ and since there is plenty of room here, it @@ -366,7 +385,14 @@ function new_attribute(name, silent) error("No room for a new \\attribute", 1) end end + local lsc = tex.count[luatex_sty_counter] + if lsc and lsc > last_alloc then + last_alloc = lsc + end last_alloc = last_alloc + 1 + if lsc then + tex.setcount('global', luatex_sty_counter, last_alloc) + end attributes[name] = last_alloc unset_attribute(name) if not silent then -- cgit v1.2.3 From 167c1b6ba8310c4adc0275fab52e746711aadab5 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Sun, 28 Apr 2013 20:27:55 +0200 Subject: I had forgotten something... --- luatexbase-attr.dtx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx index be0a91c..ded08b3 100644 --- a/luatexbase-attr.dtx +++ b/luatexbase-attr.dtx @@ -363,10 +363,14 @@ attributes = {} % % \begin{macrocode} local luatex_sty_counter = 'LuT@AllocAttribute' -if tex.count[luatex_sty_counter] and tex.count[luatex_sty_counter] > -1 then - error("luatexbase error: attribute 0 has already been set by \newattribute" - .."macro from luatex.sty, not belonging to this package, this makes" - .."luaotfload unuseable. Please report to the maintainer of luatex.sty") +if tex.count[luatex_sty_counter] then + if tex.count[luatex_sty_counter] > -1 then + error("luatexbase error: attribute 0 has already been set by \newattribute" + .."macro from luatex.sty, not belonging to this package, this makes" + .."luaotfload unuseable. Please report to the maintainer of luatex.sty") + else + tex.count[luatex_sty_counter] = 0 + end end % \end{macrocode} % -- cgit v1.2.3