summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/luatex/luatexbase/luatexbase-compat.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/luatex/luatexbase/luatexbase-compat.dtx')
-rw-r--r--Master/texmf-dist/source/luatex/luatexbase/luatexbase-compat.dtx98
1 files changed, 46 insertions, 52 deletions
diff --git a/Master/texmf-dist/source/luatex/luatexbase/luatexbase-compat.dtx b/Master/texmf-dist/source/luatex/luatexbase/luatexbase-compat.dtx
index e518e0d6695..4da25225890 100644
--- a/Master/texmf-dist/source/luatex/luatexbase/luatexbase-compat.dtx
+++ b/Master/texmf-dist/source/luatex/luatexbase/luatexbase-compat.dtx
@@ -1,7 +1,6 @@
% \iffalse meta-comment
%
-% Written in 2010 by Manuel Pégourié-Gonnard.
-% <mpg@elzevir.fr>
+% Copyright 2010, 2011 by Manuel Pégourié-Gonnard <mpg@elzevir.fr>
%
% This work is under the CC0 license.
%
@@ -15,11 +14,6 @@
% Documentation:
% pdflatex luatexbase-compat.dtx
%
-% The class ltxdoc loads the configuration file ltxdoc.cfg
-% if available. Here you can specify further options, e.g.
-% use A4 as paper format:
-% \PassOptionsToClass{a4paper}{article}
-%
%<*ignore>
\begingroup
\def\x{LaTeX2e}%
@@ -37,10 +31,7 @@
\preamble
-Written in 2010 by Manuel Pegourie-Gonnard.
-
-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
@@ -102,15 +93,20 @@ See source file '\inFileName' for details.
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
-% \pkdate{luatexbase-compat}{2010/10/10 v0.3}
+% \pkdate{luatexbase-compat}{2011/05/24 v0.4}
%
% \maketitle
%
% \begin{abstract}
% The \luatex manual is very clear: everything may change. This package
% provides tools to help package writers deal with the changes. It helps
-% supporting \luatex versions down to 0.25.4, and is regularly tested with
-% \luatex 0.40.6 (\texlive 2009) and from trunk.
+% supporting \luatex versions down to 0.25.4, and is tested with
+% \luatex 0.40.6 (\texlive 2009), \luatex 0.60.2 (\texlive 2010) and current
+% beta versions.
+%
+% The supported formats are Plain and \latex adapted for \luatex as provided
+% by \texlive and MiK\tex (see \file{lualatex-doc.pdf} section~4 for details
+% about these formats).
% \end{abstract}
%
% \tableofcontents
@@ -119,7 +115,8 @@ See source file '\inFileName' for details.
%
% Three problems are currently addressed by this package: changes in the
% syntax of |\directlua|, version information, and variable policies for
-% primitives activation and naming (in \luatex itself as well as in \texlive).
+% primitives activation and naming (in \luatex itself as well as in the
+% formats provided by distributions).
%
% \medskip
%
@@ -132,8 +129,8 @@ See source file '\inFileName' for details.
%
% This package provides a macro |\luatexbase@directlua| that expands to
% |\directlua0| on \luatex 0.35 and lower (where the number is mandatory), and
-% to |\directlua| otherwise. It is a macro in both case so that the number of
-% expansion steps remains constant.
+% to |\directlua| otherwise. It is a macro in both cases so that it always
+% expands in exactly two steps.
%
% \medskip
%
@@ -161,16 +158,16 @@ See source file '\inFileName' for details.
% So, starting with \texlive 2009, the situation is clear: the prefixed
% version of the \luatex primitives is always available. But in earlier
% versions (\texlive 2008, \luatex 0.25.4) those primitives were available
-% only with their natural names. Also, it is theoretically possible, however
-% unlikely, that the prefixed primitives are not available for some reason.
+% only with their natural names. The primitives provided by \etex and pdf\tex
+% on the other hand, are always available.
%
% \begin{quote}
% \cs{luatexbase@ensure@primitive}\marg{name}
% \end{quote}
% The tool provided to deal with that is \cs{luatexbase@ensure@primitive},
-% whose argument is a primitive name (without a leading backslash nor any
-% |luatex| prefix, eg just |{latelua}|). It makes sure that the primitive gets
-% available as \cs{luatex\meta{name}}.
+% whose argument is a \luatex primitive name (without a leading backslash nor
+% any |luatex| prefix, eg just |{latelua}|). It makes sure that the primitive
+% gets available as \cs{luatex\meta{name}}.
%
% \textbf{Warning.} In particular circumstances, this macro may fail silently
% for primitives whose natural name starts with |luatex|, hence such
@@ -189,7 +186,7 @@ See source file '\inFileName' for details.
% to use (except |\directlua| again).
%
% This package doesn't try to activate every primitive, since it would require
-% and extensive list of primitives for each version of \luatex, so it seems
+% an extensive list of primitives for each version of \luatex, so it seems
% simpler to leave that burden on package writers.
%
% \section{Implementation}
@@ -200,48 +197,46 @@ See source file '\inFileName' for details.
%
% \subsection{Preliminaries}
%
-% Reload protection, especially for \plaintex.
-%
-% \begin{macrocode}
- \csname lltxb@compat@loaded\endcsname
-\expandafter\let\csname lltxb@compat@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 58 12 % :
\y 60 12 % <
- \y 61 12 % =
- \y 64 11 % @ (letter)
- \y 62 12 % >
- \y 95 12 % _ (other)
+ \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@compat@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@compat@sty@endinput\endcsname%
% \end{macrocode}
%
% Package declaration.
@@ -254,7 +249,7 @@ See source file '\inFileName' for details.
\let\x\ProvidesPackage
\fi
\expandafter\endgroup
-\x{luatexbase-compat}[2010/10/10 v0.3 Compatibility tools for LuaTeX]
+\x{luatexbase-compat}[2011/05/24 v0.4 Compatibility tools for LuaTeX]
% \end{macrocode}
%
% Make sure \luatex is used.
@@ -275,12 +270,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-compat}{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@compat@AtEnd
- \expandafter\endinput
+ \expandafter\luatexbase@compat@sty@endinput%
\fi
% \end{macrocode}
%
@@ -381,7 +375,7 @@ See source file '\inFileName' for details.
% That's all folks!
%
% \begin{macrocode}
-\lltxb@compat@AtEnd
+\luatexbase@compat@sty@endinput%
%</texpackage>
% \end{macrocode}
%