From 6486bb6dd718eb0946f4ce7ef2b2d86913b9e481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 11 Mar 2010 18:22:44 +0100 Subject: Use luatexbase as the Lua module name. --- luatexbase-attr.dtx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx index 511861c..d5087f9 100644 --- a/luatexbase-attr.dtx +++ b/luatexbase-attr.dtx @@ -160,7 +160,7 @@ and the derived files % definition of |\fooattr| and remember it in a Lua variable. For your % convenience, this is automatically done by |\newluatexattribute|: the number % is remembered in a dedicated Lua table so that you can get it as -% |luatextra.attributes.foobar| (mind the absence of backslash here) at any +% |luatexbase.attributes.foobar| (mind the absence of backslash here) at any % time. % % \section{Implementation} @@ -247,7 +247,7 @@ and the derived files \fi \unsetluatexattribute#1% \begingroup\escapechar\m@ne \expandafter\endgroup - \directlua{luatextra.attributedef_from_tex( + \directlua{luatexbase.attributedef_from_tex( '\luatexluaescapestring{\string#1}', '\number\allocationnumber')}% \wlog{\string#1=\string\luatexattribute\the\allocationnumber}% \else @@ -284,7 +284,7 @@ and the derived files % % \begin{macrocode} %<*luamodule> -module('luatextra', package.seeall) +module('luatexbase', package.seeall) % \end{macrocode} % % Record the allocation number in a Lua table. @@ -315,13 +315,13 @@ end \newluatexattribute\testattr \setluatexattribute\testattr{1} \unsetluatexattribute\testattr -\directlua{assert(luatextra.attributes.testattr)} +\directlua{assert(luatexbase.attributes.testattr)} \begingroup \escapechar64 \newluatexattribute\anotherattr \endgroup \setluatexattribute\anotherattr{1} -\directlua{assert(luatextra.attributes.anotherattr)} +\directlua{assert(luatexbase.attributes.anotherattr)} % %\bye %\stop -- cgit v1.2.3 From 8f6a797ab68d6aa3f79b1c360c8de126bf77b5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 11 Mar 2010 18:24:36 +0100 Subject: Stop writing in the tex table. --- Changes | 5 +++++ TODO | 12 ------------ luatexbase-attr.dtx | 1 - 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Changes b/Changes index c970991..b6b1be9 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Changes in the luatexbase package/bundle +[on-going] + luatexbase-attr + - use luatexbase as the Lua module name + - don't creat tex.attributenumber + 2010/03/11 luatexbase-attrs 0.1 - add minimal test files for luatex and lualatex diff --git a/TODO b/TODO index b548346..7ad6c7f 100644 --- a/TODO +++ b/TODO @@ -16,15 +16,3 @@ Later ===== - change lua module name(s) (luatexbase or luatexbase.regs etc) - -regs ----- - -- Should the various allocation macros set something in a Lua table, or should - we just wait for it to be implemented in LuaTeX? (The \*blk macros would be -rather tricky in this respect, but are they really used?) - -attr ---- - -- don't write in the tex table! diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx index d5087f9..4db2122 100644 --- a/luatexbase-attr.dtx +++ b/luatexbase-attr.dtx @@ -291,7 +291,6 @@ module('luatexbase', package.seeall) % % \begin{macrocode} attributes = {} -tex.attributenumber = attributes function attributedef_from_tex(name, number) attributes[name] = tonumber(number) end -- cgit v1.2.3 From e93e40e44167098e535e26cc41e3daf0fdb81245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Sat, 27 Mar 2010 14:25:12 +0100 Subject: Cleanup Lua names. --- Changes | 5 ++++- TODO | 9 --------- luatexbase-cctb.dtx | 28 +++++++++++++--------------- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/Changes b/Changes index 9fd6732..f6afb4b 100644 --- a/Changes +++ b/Changes @@ -3,7 +3,10 @@ [on-going] luatexbase-attr - use luatexbase as the Lua module name - - don't creat tex.attributenumber + - don't create tex.attributenumber + luatexbase-cctb + - use luatexbase as the Lua module name + - don't create tex.catcodetablenumber 2010/03/26 luatexbase-cctb 0.1 diff --git a/TODO b/TODO index b893c91..42c735f 100644 --- a/TODO +++ b/TODO @@ -18,16 +18,7 @@ Later - change lua module name(s) (luatexbase or luatexbase.regs etc) -regs ----- - -- Should the various allocation macros set something in a Lua table, or should - we just wait for it to be implemented in LuaTeX? (The \*blk macros would be -rather tricky in this respect, but are they really used?) Well, is there any -actual need for this? - cctb ---- -- don't write in the tex table! - don't define macros starting with \luatex diff --git a/luatexbase-cctb.dtx b/luatexbase-cctb.dtx index 5eeefc9..7c6a907 100644 --- a/luatexbase-cctb.dtx +++ b/luatexbase-cctb.dtx @@ -175,7 +175,7 @@ and the derived files % catcode table. Since |\chardef| is used for the definition of the control % sequence, this is rather easy to do. However, for extra ease of use, the % numbers are also directly accessible from Lua as the value of the table -% |luatextra.catcodetables|, whose keys is the name of the control sequence +% |luatexbase.catcodetables|, whose keys is the name of the control sequence % (without any leading backslash). Moreover, nickames are available for the % predefined catcode tables: % \begin{itemize} @@ -270,7 +270,7 @@ and the derived files \global\chardef#1\allocationnumber \luatexinitcatcodetable\allocationnumber \begingroup\escapechar\m@ne \expandafter\endgroup - \directlua{luatextra.catcodetabledef_from_tex( + \directlua{luatexbase.catcodetabledef_from_tex( '\luatexluaescapestring{\string#1}', '\number\allocationnumber')}% \wlog{\string#1=\string\luatexcatcodetable\the\allocationnumber}% \else @@ -391,7 +391,7 @@ and the derived files % Finally do the shortcuts. % % \begin{macrocode} -\directlua{luatextra.catcodetable_do_shortcuts()} +\directlua{luatexbase.catcodetable_do_shortcuts()} % % \end{macrocode} % @@ -399,28 +399,26 @@ and the derived files % % \begin{macrocode} %<*luamodule> -module('luatextra', package.seeall) +module('luatexbase', package.seeall) % \end{macrocode} % -% In the same way, the table \texttt{tex.catcodetablenumber} contains the -% numbers of the catcodetables registered with -% \texttt{\string\newluacatcodetable}. +% The number associated to a CS name is remembered in the |catcodetables| +% table. % % \begin{macrocode} catcodetables = {} -tex.catcodetablenumber = catcodetables function catcodetabledef_from_tex(name, number) catcodetables[name] = tonumber(number) end % \end{macrocode} % -% With this function we create some shortcuts for a better readability in -% lua code. This makes |tex.catcodetablenumber.latex| equivalent to -% |tex.catcodetablenumber['CatcodeTableLaTeX']|. +% The next function creates some shortcuts for better readability in lua +% code. This makes |luatexbase.catcodetables.latex| equivalent to +% |luatexbase.catcodetables.CatcodeTableLaTeX|. % % \begin{macrocode} function catcodetable_do_shortcuts() - local cat = luatextra.catcodetables + local cat = catcodetables cat['latex'] = cat.CatcodeTableLaTeX cat['latex-package'] = cat.CatcodeTableLaTeXAtLetter cat['latex-atletter'] = cat.CatcodeTableLaTeXAtLetter @@ -447,7 +445,7 @@ end %\RequirePackage{luatexbase-cctb} %<*testplain,testlatex> \newluatexcatcodetable\testcctb -\directlua{assert(luatextra.catcodetables.testcctb)} +\directlua{assert(luatexbase.catcodetables.testcctb)} % \end{macrocode} % % Also check that the catcodetable's number is remembered well, @@ -458,7 +456,7 @@ end \escapechar64 \newluatexcatcodetable\anothercctb \endgroup -\directlua{assert(luatextra.catcodetables.anothercctb)} +\directlua{assert(luatexbase.catcodetables.anothercctb)} % \end{macrocode} % % Now, play a little bit with predefined tables. @@ -471,7 +469,7 @@ end %\documentclass{minimal} \directlua{% tex.sprint('\string\\setbox0=\string\\hbox{') - tex.sprint(luatextra.catcodetables.string, "\string\\undef # _^&") + tex.sprint(luatexbase.catcodetables.string, "\string\\undef # _^&") tex.sprint('}') } % \end{macrocode} -- cgit v1.2.3 From 86a8b1f74fad27b60acb9a14f0ad74a0f020885a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Sat, 27 Mar 2010 14:31:03 +0100 Subject: s/\luatexsetcatcoderange/\setcatcoderange/ --- Changes | 1 + TODO | 6 +----- luatexbase-cctb.dtx | 10 +++++----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index f6afb4b..decd17b 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,7 @@ luatexbase-cctb - use luatexbase as the Lua module name - don't create tex.catcodetablenumber + - rename \luatexsetcatcoderange to \setcatcoderange 2010/03/26 luatexbase-cctb 0.1 diff --git a/TODO b/TODO index 42c735f..fa38543 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,6 @@ general - write test files - change prefix for internal TeX macros - check for lua name conflicts ('module' used in mods) -- check for macros starting with \luatex - make TeX tests cleaner: \begingroup\expandafter\ETC. - reload check, declaration, luatex test, catcodes for plain - import/update doc @@ -17,8 +16,5 @@ Later ===== - change lua module name(s) (luatexbase or luatexbase.regs etc) +- check for macros starting with \luatex -cctb ----- - -- don't define macros starting with \luatex diff --git a/luatexbase-cctb.dtx b/luatexbase-cctb.dtx index 7c6a907..198da9c 100644 --- a/luatexbase-cctb.dtx +++ b/luatexbase-cctb.dtx @@ -142,7 +142,7 @@ and the derived files % (once they are allocated), two helper macros are available. % % \begin{quote} -% \cs{luatexsetcatcoderange}\marg{from}\marg{to}\marg{value} +% \cs{setcatcoderange}\marg{from}\marg{to}\marg{value} % \end{quote} % Set all characters code in the range \meta{from}--\meta{to} to the given % catcode \meta{value}. @@ -292,7 +292,7 @@ and the derived files % Set the catcodes for a range of characters. % % \begin{macrocode} -\def\luatexsetcatcoderange#1#2#3{% +\def\setcatcoderange#1#2#3{% \edef\luaSCR@temp{% \noexpand\@tempcnta=\the\@tempcnta \noexpand\@tempcntb=\the\@tempcntb @@ -333,8 +333,8 @@ and the derived files \catcode0 12 % nul \catcode13 12 % carriage return \catcode37 12 % percent - \luatexsetcatcoderange{65}{90}{12}% A-Z - \luatexsetcatcoderange{97}{122}{12}% a-z + \setcatcoderange{65}{90}{12}% A-Z + \setcatcoderange{97}{122}{12}% a-z \catcode92 12 % backslash \catcode127 12 } % \end{macrocode} @@ -352,7 +352,7 @@ and the derived files \newluatexcatcodetable\CatcodeTableLaTeX \setluatexcatcodetable\CatcodeTableLaTeX{% \luatexcatcodetable\CatcodeTableIniTeX - \luatexsetcatcoderange{0}{31}{15}% + \setcatcoderange{0}{31}{15}% \catcode9 10 % tab \catcode12 13 % form feed \catcode13 5 % carriage return -- cgit v1.2.3