% \iffalse
%% File: l3names.dtx Copyright (C) 1990-2006 LaTeX3 project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
%% license or (at your option) any later version.  The latest version
%% of this license is in the file
%%
%%    http://www.latex-project.org/lppl.txt
%%
%% This file is part of the ``expl3 bundle'' (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%%
%% The released version of this bundle is available from CTAN.
%%
%% -----------------------------------------------------------------------
%%
%% The development version of the bundle can be found at
%%
%%    http://www.latex-project.org/cgi-bin/cvsweb.cgi/
%%
%% for those people who are interested.
%%
%%%%%%%%%%%
%% NOTE: %%
%%%%%%%%%%%
%%
%%   Snapshots taken from the repository represent work in progress and may
%%   not work or may contain conflicting material!  We therefore ask
%%   people _not_ to put them into distributions, archives, etc. without
%%   prior consultation with the LaTeX Project Team.
%%
%% -----------------------------------------------------------------------
%^^A We need some basic initial character codes to be set up
%^^A immediately.
%<*initex>
\catcode`\{=1 % left brace is begin-group character
\catcode`\}=2 % right brace is end-group character
\catcode`\#=6 % hash mark is macro parameter character
\catcode`\^=7 %
\catcode`\^^I=10 % ascii tab is a blank space
\def\GetIdInfo$Id: #1.dtx #2 #3-#4-#5 #6 #7$#8{%
  \immediate\write-1{#1; v#2, #3/#4/#5; #8}%
}
%</initex>
%<*package>
\def\GetIdInfo$Id: #1.dtx #2 #3-#4-#5 #6 #7$#8{%
  \def\fileversion{#2}%
  \def\filedate{#3/#4/#5}%
  \ProvidesPackage{#1}[#3/#4/#5 v#2 #8]%
}
%</package>
%<*dtx>
%\fi
\def\GetIdInfo$Id: #1.dtx #2 #3-#4-#5 #6 #7$#8{%
  \def\fileversion{#2}%
  \def\filedate{#3/#4/#5}%
  \ProvidesFile{#1.dtx}[#3/#4/#5 v#2 #8]%
}
%\iffalse
%</dtx>
%\fi
\GetIdInfo$Id: l3names.dtx 577 2006-11-21 18:10:26Z morten $
     {L3 Experimental Naming Scheme for TeX Primitives}
%
%
% \iffalse
%<*driver>
\documentclass{l3doc}
\begin{document}
\DocInput{l3names.dtx}
\end{document}
%</driver>
% \fi
%
% \title{The \textsf{l3names} package\thanks{This file
%         has version number \fileversion, last
%         revised \filedate.}\\
% A systematic naming scheme for \TeX}
% \author{\Team}
% \date{\filedate}
% \maketitle
%
% \changes{v2.0a}{1997/08/04}
%      {new consistent tex module name for \TeX\ primitives}
%
% \begin{abstract}
% This package sets up an experimental naming scheme for
% \LaTeX\ commands. It allows the \LaTeX\ programmer to systematically
% name functions and variables, and specify the argument types of
% functions.
%
% The \TeX\ primitives are all given a new name according to these
% conventions.
%
% \begin{bfseries}
% Warning: This package, and all packages using it should be regarded as
% \emph{expermiental}!
%
% The names of these packages, and the names and syntax of any commands
% defined in them might change at any time.
%
% These conventions are being distributed in this form to encourage
% discussion and experimentation. It is \emph{not} intentended that
% these packages be used in `real' documents at this stage.
% \end{bfseries}
% \end{abstract}
%
%
% \section{Conventions}
%
% This section gives an overview of the syntax for \LaTeX\ commands
% that is set up for use in these `experimental' pacages.
%
% Commands in \LaTeX3 are either functions or parameters. All
% primitive commands of \TeX{} have private names.
%
% \subsection{Functions}
%
% Functions have the following general syntax:
% \begin{quote}
%   |\|\m{module}|_|\m{description}|:|\m{arg-spec}
% \end{quote}
% where \m{module} is one of the (to be) chosen module names and
% \m{description} is a verbal description of the functionality.
% \m{arg-spec} finally describes the type of arguments that the
% function takes and is left empty if it is a function without
% arguments.
%
% All three parts consists of letters only \m{description} is allowed
% to take further |_| characters to separate words is necessary.
%
% Currently there exists some functions which don't have a proper
% \m{module} name.
%
% As a semi-formalized concept the letter |g| is sometimes used to
% prefix the \m{module} name and certain parts of the \m{description}
% to mark the function as ``globally acting''.
%
% The \m{arg-spec} currently supports the following types of
% arguments:
% \begin{description}
%
% \item[n] Unexpanded token (or token-list if in braces) braces.
%
% \item[o] One time expanded token or token-list. In the latter case,
% effectively only the first token in the list gets expanded. Since
% the expansion might result in more than one token, the result is
% surrounded for further processing with braces.
%
% \item[x] Fully expanded token or token-list. Like |o| but the
% argument is expanded using |\def:Npx| before it is passed on.
%
% \item[c] A character string or a token-list that expands to
% characters of catcode 11 or 12. This string (after expansion) is
% used to construct a command name that is eventually passed on.
%
% \item[N,O,X] Like |n|, |o|, |x| but the argument must be a single
% token without any braces around it.
%
% \item[w] One or more arguments with ``weird'' syntax that one has
% to know by heart or better leave it alone.
%
% \item[p] Denotes parameter text specification part, e.g.\^^M
% |#1#2\q_stop#3|.
%
% \item[T,F] denotes the ``true'' or the ``false'' case in a
% functional predicate.
%
% \end{description}
%
% Especially for the new names of \TeX{} primitives there are is one
% more character to denote arguments. It implies that these
% functions should not be used outside this bootstrapping file.
% \begin{description}
%
% \item[D] Zero or more arguments with  ``weird'' syntax. Uppercase
% ``D''  means (DON'T USE IT), i.e.,
% that this is a primitive \TeX{} command that should
% not show up in code except in the very basic functions of \LaTeX3
% that provide a more sensible interface.
%
% \end{description}
%
% One could perhaps envisage an extended system which allocated
% letters to denote the various primitive argument types available in
% \TeX, however it seems that this just complicates the system
% without adding any real benefit, as these primitives would never be
% used in production code, as higher level packages should offer a
% better interface. Thus the following letters, although they were
% considered have not been used. ``D'' is used in most cases in
% preference.
% \begin{description}
% \item[i] Denotes an integer in \TeX{} notation (which might be a
% register or \dots).
%
% \item[d] Denotes a dimension in \TeX{} notation.
%
% \item[g] Denotes a glue in \TeX{} notation.
%
% \item[m] Denotes an muglue or mukern in \TeX{} notation.
%
% \item[b] Denotes a box specification in \TeX{} notation (again
% something pretty arbitrary).
%
% \item[r] Denotes a rule specification in \TeX{} notation.
%
% \end{description}
%
% Some of the primitive functions below are flagged ``D'' even if
% they actually might be useful in average code. So certainly there
% are some adjustments necessary. It all depends whether or not we
% provide some safer interface or leave them alone.
%
% \subsection{Parameters}
%
% Parameter names have the following general syntax:
% \begin{quote}
%   |\|\m{access}|_|\m{module}|_|\m{description}|_|\m{type}
% \end{quote}
%
% \m{module} and \m{description} is as above. \m{type} should denote
% the type of parameter if this helps in using it. The currently used
% types are:
% \begin{description}
%
% \item[int] Integer valued.
%
% \item[factor] Another integer value type. Used for things where the
% parameter is used as a factor for something else.
%
% \item[status] The sort of boolean stuff \TeX{} provides. Essentially
% an integer with the meaning |0| = `off' and other values may or may
% not have sensible meanings.
%
% \item[pen] Another integer describing penalties.
%
% \item[dem] The demerits.
%
% \item[dim] A dimension.
%
% \item[skip] A glue value.
%
% \item[toks] A toks register (sort of).
%
% \item[char] An integer denoting a character.
%
% \item[muskip] A math unit.
%
% \end{description}
%
% \m{access} describes how the parameter can be accessed. The
% following characters are possible:
% \begin{description}
%
% \item[c] A constant. Should not be set in the code except with
% special functions to define the value for the whole processing.
%
% \item[C] A constant according to \TeX's rules. Can not be changed at
% all.
%
% \item[l] A local variable which therefore should not be changed
% globally.
%
% \item[L] A local variable that is usually set (and/or reset) by
% \TeX{} itself.
%
% \item[g] A global variable.
%
% \item[G] A global variable that is usually set (and/or reset by \TeX.
%
% \item[R] A  variable that is set (and changed) by \TeX{} and can not
% be changed by in the code (read-only).
%
% \end{description}
%
%
%
% \section{Modules}
%
% Nearly all operations of \LaTeX3 are carried out by calling control
% sequences. For better programming concepts many types of functions are
% identified and gathered in modules. Functions in such modules starts
% with special prefixes, for example "\tlp_" is the prefix for functions
% dealing with token list pointers.
%
%
%
% \StopEventually{}
%
% \section{Starters}
%
%    This is the base part of \LaTeX3 defining things like |catcode|s
%    and redefining the \TeX{} primitives.
%
%    We start by setting up |\catcode|s that we need to define new
%    commands. These are the ones for begin-group and end-group
%    characters.\footnote{Well not needed while this file is running
%    as a package on top of \LaTeXe, so omitted from the package code}
%    \begin{macrocode}
%<*initex>
\catcode`\{=1 % left brace is begin-group character
\catcode`\}=2 % right brace is end-group character
\catcode`\#=6 % hash mark is macro parameter character
\catcode`\^=7 %
\catcode`\^^I=10 % ascii tab is a blank space
%</initex>
%    \end{macrocode}
%
%    \begin{macrocode}
%<*initex|package>
\catcode`\ =9\relax
\catcode`\^^I=9\relax
\catcode`\^^M=9\relax
\catcode`\~=10\relax
\catcode`\_=11\relax\catcode`\:=11\relax
\catcode`\@=11\relax                 % as long as we use old LaTeX stuff.
%    \end{macrocode}
%
%
% \section{Setting up primitive names}
%
%    Here is the function that renames \TeX{}'s primitives.
%
% Normally the old name is left untouched, but the possibility of
% undefining the original names is made available by docstrip and
% package options.
% If nothing else, this gives a way of checking what `old code' a
% package depends on\ldots\
%
% If the package option `removeoldnames' is used then some trick code
% is run after the end of this file, to skip past the code which has
% been inserted by \LaTeXe\ to manage the file name stack, this code
% would break if run once the \TeX\ primitives have been undefined.
% (What a surprise!)
%
% To get things started, give a new name for |\let|.
%    \begin{macrocode}
\let\tex_let:D\let
%</initex|package>
%    \end{macrocode}
%
% and now an internal function to  possibly
% remove the old name.
%
%    \begin{macrocode}
%<*initex>
\long\def\name_undefine:N#1{
    \tex_let:D#1\c_undefined}
%</initex>
%    \end{macrocode}
%
%    \begin{macrocode}
%<*package>
\DeclareOption{removeoldnames}{
  \long\def\name_undefine:N#1{
    \tex_let:D#1\c_undefined}}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareOption{keepoldnames}{
  \long\def\name_undefine:N#1{}}
%    \end{macrocode}
%
%    \begin{macrocode}
\ExecuteOptions{keepoldnames}
%    \end{macrocode}
%
%    \begin{macrocode}
\ProcessOptions
%</package>
%    \end{macrocode}
%
% The internal function to give the new name and possibly undefine
% the old name.
%    \begin{macrocode}
%<*initex|package>
\long\def\name_primitive:NN#1#2{
  \tex_let:D #2 #1
  \name_undefine:N #1
      }
%    \end{macrocode}
%
% \subsection{Assignments}
%
% In the current incarnation of this package, all \TeX\ primitives
% are given a new name of the form |\tex_|\emph{oldname}|:D|.
% But first three special cases which have symbolic original names.
% These are given modified new names, so that they may be entered
% without catcode tricks.
%    \begin{macrocode}
\name_primitive:NN \                      \tex_space:D
\name_primitive:NN \/                     \tex_italiccor:D
\name_primitive:NN \-                     \tex_hyphen:D
%    \end{macrocode}
%
% Now all the other primitives.
%    \begin{macrocode}
\name_primitive:NN \let                   \tex_let:D
\name_primitive:NN \def                   \tex_def:D
\name_primitive:NN \edef                  \tex_edef:D
\name_primitive:NN \gdef                  \tex_gdef:D
\name_primitive:NN \xdef                  \tex_xdef:D
\name_primitive:NN \chardef               \tex_chardef:D
\name_primitive:NN \countdef              \tex_countdef:D
\name_primitive:NN \dimendef              \tex_dimendef:D
\name_primitive:NN \skipdef               \tex_skipdef:D
\name_primitive:NN \muskipdef             \tex_muskipdef:D
\name_primitive:NN \mathchardef           \tex_mathchardef:D
\name_primitive:NN \toksdef               \tex_toksdef:D
\name_primitive:NN \futurelet             \tex_futurelet:D
\name_primitive:NN \advance               \tex_advance:D
\name_primitive:NN \divide                \tex_divide:D
\name_primitive:NN \multiply              \tex_multiply:D
\name_primitive:NN \font                  \tex_font:D
\name_primitive:NN \fam                   \tex_fam:D
\name_primitive:NN \global                \tex_global:D
\name_primitive:NN \long                  \tex_long:D
\name_primitive:NN \outer                 \tex_outer:D
\name_primitive:NN \setlanguage           \tex_setlanguage:D
\name_primitive:NN \globaldefs            \tex_globaldefs:D
\name_primitive:NN \afterassignment       \tex_afterassignment:D
\name_primitive:NN \aftergroup            \tex_aftergroup:D
\name_primitive:NN \expandafter           \tex_expandafter:D
\name_primitive:NN \noexpand              \tex_noexpand:D
\name_primitive:NN \begingroup            \tex_begingroup:D
\name_primitive:NN \endgroup              \tex_endgroup:D
\name_primitive:NN \halign                \tex_halign:D
\name_primitive:NN \valign                \tex_valign:D
\name_primitive:NN \cr                    \tex_cr:D
\name_primitive:NN \crcr                  \tex_crcr:D
\name_primitive:NN \noalign               \tex_noalign:D
\name_primitive:NN \omit                  \tex_omit:D
\name_primitive:NN \span                  \tex_span:D
\name_primitive:NN \tabskip               \tex_tabskip:D
\name_primitive:NN \everycr               \tex_everycr:D
\name_primitive:NN \if                    \tex_if:D
\name_primitive:NN \ifcase                \tex_ifcase:D
\name_primitive:NN \ifcat                 \tex_ifcat:D
\name_primitive:NN \ifnum                 \tex_ifnum:D
\name_primitive:NN \ifodd                 \tex_ifodd:D
\name_primitive:NN \ifdim                 \tex_ifdim:D
\name_primitive:NN \ifeof                 \tex_ifeof:D
\name_primitive:NN \ifhbox                \tex_ifhbox:D
\name_primitive:NN \ifvbox                \tex_ifvbox:D
\name_primitive:NN \ifvoid                \tex_ifvoid:D
\name_primitive:NN \ifx                   \tex_ifx:D
\name_primitive:NN \iffalse               \tex_iffalse:D
\name_primitive:NN \iftrue                \tex_iftrue:D
\name_primitive:NN \ifhmode               \tex_ifhmode:D
\name_primitive:NN \ifmmode               \tex_ifmmode:D
\name_primitive:NN \ifvmode               \tex_ifvmode:D
\name_primitive:NN \ifinner               \tex_ifinner:D
\name_primitive:NN \else                  \tex_else:D
\name_primitive:NN \fi                    \tex_fi:D
\name_primitive:NN \or                    \tex_or:D
\name_primitive:NN \immediate             \tex_immediate:D
\name_primitive:NN \closeout              \tex_closeout:D
\name_primitive:NN \openin                \tex_openin:D
\name_primitive:NN \openout               \tex_openout:D
\name_primitive:NN \read                  \tex_read:D
\name_primitive:NN \write                 \tex_write:D
\name_primitive:NN \closein               \tex_closein:D
\name_primitive:NN \newlinechar           \tex_newlinechar:D
\name_primitive:NN \input                 \tex_input:D
\name_primitive:NN \endinput              \tex_endinput:D
\name_primitive:NN \inputlineno           \tex_inputlineno:D
\name_primitive:NN \errmessage            \tex_errmessage:D
\name_primitive:NN \message               \tex_message:D
\name_primitive:NN \show                  \tex_show:D
\name_primitive:NN \showthe               \tex_showthe:D
\name_primitive:NN \showbox               \tex_showbox:D
\name_primitive:NN \showlists             \tex_showlists:D
\name_primitive:NN \errhelp               \tex_errhelp:D
\name_primitive:NN \errorcontextlines     \tex_errorcontextlines:D
\name_primitive:NN \tracingcommands       \tex_tracingcommands:D
\name_primitive:NN \tracinglostchars      \tex_tracinglostchars:D
\name_primitive:NN \tracingmacros         \tex_tracingmacros:D
\name_primitive:NN \tracingonline         \tex_tracingonline:D
\name_primitive:NN \tracingoutput         \tex_tracingoutput:D
\name_primitive:NN \tracingpages          \tex_tracingpages:D
\name_primitive:NN \tracingparagraphs     \tex_tracingparagraphs:D
\name_primitive:NN \tracingrestores       \tex_tracingrestores:D
\name_primitive:NN \tracingstats          \tex_tracingstats:D
\name_primitive:NN \pausing               \tex_pausing:D
\name_primitive:NN \showboxbreadth        \tex_showboxbreadth:D
\name_primitive:NN \showboxdepth          \tex_showboxdepth:D
\name_primitive:NN \batchmode             \tex_batchmode:D
\name_primitive:NN \errorstopmode         \tex_errorstopmode:D
\name_primitive:NN \nonstopmode           \tex_nonstopmode:D
\name_primitive:NN \scrollmode            \tex_scrollmode:D
\name_primitive:NN \end                   \tex_end:D
\name_primitive:NN \csname                \tex_csname:D
\name_primitive:NN \endcsname             \tex_endcsname:D
\name_primitive:NN \ignorespaces          \tex_ignorespaces:D
\name_primitive:NN \relax                 \tex_relax:D
\name_primitive:NN \the                   \tex_the:D
\name_primitive:NN \mag                   \tex_mag:D
\name_primitive:NN \language              \tex_language:D
\name_primitive:NN \mark                  \tex_mark:D
\name_primitive:NN \topmark               \tex_topmark:D
\name_primitive:NN \firstmark             \tex_firstmark:D
\name_primitive:NN \botmark               \tex_botmark:D
\name_primitive:NN \splitfirstmark        \tex_splitfirstmark:D
\name_primitive:NN \splitbotmark          \tex_splitbotmark:D
\name_primitive:NN \fontname              \tex_fontname:D
\name_primitive:NN \escapechar            \tex_escapechar:D
\name_primitive:NN \endlinechar           \tex_endlinechar:D
\name_primitive:NN \mathchoice            \tex_mathchoice:D
\name_primitive:NN \delimiter             \tex_delimiter:D
\name_primitive:NN \mathaccent            \tex_mathaccent:D
\name_primitive:NN \mathchar              \tex_mathchar:D
\name_primitive:NN \mskip                 \tex_mskip:D
\name_primitive:NN \radical               \tex_radical:D
\name_primitive:NN \vcenter               \tex_vcenter:D
\name_primitive:NN \mkern                 \tex_mkern:D
\name_primitive:NN \above                 \tex_above:D
\name_primitive:NN \abovewithdelims       \tex_abovewithdelims:D
\name_primitive:NN \atop                  \tex_atop:D
\name_primitive:NN \atopwithdelims        \tex_atopwithdelims:D
\name_primitive:NN \over                  \tex_over:D
\name_primitive:NN \overwithdelims        \tex_overwithdelims:D
\name_primitive:NN \displaystyle          \tex_displaystyle:D
\name_primitive:NN \textstyle             \tex_textstyle:D
\name_primitive:NN \scriptstyle           \tex_scriptstyle:D
\name_primitive:NN \scriptscriptstyle     \tex_scriptscriptstyle:D
\name_primitive:NN \nonscript             \tex_nonscript:D
\name_primitive:NN \eqno                  \tex_eqno:D
\name_primitive:NN \leqno                 \tex_leqno:D
\name_primitive:NN \abovedisplayshortskip \tex_abovedisplayshortskip:D
\name_primitive:NN \abovedisplayskip      \tex_abovedisplayskip:D
\name_primitive:NN \belowdisplayshortskip \tex_belowdisplayshortskip:D
\name_primitive:NN \belowdisplayskip      \tex_belowdisplayskip:D
\name_primitive:NN \displaywidowpenalty   \tex_displaywidowpenalty:D
\name_primitive:NN \displayindent         \tex_displayindent:D
\name_primitive:NN \displaywidth          \tex_displaywidth:D
\name_primitive:NN \everydisplay          \tex_everydisplay:D
\name_primitive:NN \predisplaysize        \tex_predisplaysize:D
\name_primitive:NN \predisplaypenalty     \tex_predisplaypenalty:D
\name_primitive:NN \postdisplaypenalty    \tex_postdisplaypenalty:D
\name_primitive:NN \mathbin               \tex_mathbin:D
\name_primitive:NN \mathclose             \tex_mathclose:D
\name_primitive:NN \mathinner             \tex_mathinner:D
\name_primitive:NN \mathop                \tex_mathop:D
\name_primitive:NN \displaylimits         \tex_displaylimits:D
\name_primitive:NN \limits                \tex_limits:D
\name_primitive:NN \nolimits              \tex_nolimits:D
\name_primitive:NN \mathopen              \tex_mathopen:D
\name_primitive:NN \mathord               \tex_mathord:D
\name_primitive:NN \mathpunct             \tex_mathpunct:D
\name_primitive:NN \mathrel               \tex_mathrel:D
\name_primitive:NN \overline              \tex_overline:D
\name_primitive:NN \underline             \tex_underline:D
\name_primitive:NN \left                  \tex_left:D
\name_primitive:NN \right                 \tex_right:D
\name_primitive:NN \binoppenalty          \tex_binoppenalty:D
\name_primitive:NN \relpenalty            \tex_relpenalty:D
\name_primitive:NN \delimitershortfall    \tex_delimitershortfall:D
\name_primitive:NN \delimiterfactor       \tex_delimiterfactor:D
\name_primitive:NN \nulldelimiterspace    \tex_nulldelimiterspace:D
\name_primitive:NN \everymath             \tex_everymath:D
\name_primitive:NN \mathsurround          \tex_mathsurround:D
\name_primitive:NN \medmuskip             \tex_medmuskip:D
\name_primitive:NN \thinmuskip            \tex_thinmuskip:D
\name_primitive:NN \thickmuskip           \tex_thickmuskip:D
\name_primitive:NN \scriptspace           \tex_scriptspace:D
\name_primitive:NN \noboundary            \tex_noboundary:D
\name_primitive:NN \accent                \tex_accent:D
\name_primitive:NN \char                  \tex_char:D
\name_primitive:NN \discretionary         \tex_discretionary:D
\name_primitive:NN \hfil                  \tex_hfil:D
\name_primitive:NN \hfilneg               \tex_hfilneg:D
\name_primitive:NN \hfill                 \tex_hfill:D
\name_primitive:NN \hskip                 \tex_hskip:D
\name_primitive:NN \hss                   \tex_hss:D
\name_primitive:NN \vfil                  \tex_vfil:D
\name_primitive:NN \vfilneg               \tex_vfilneg:D
\name_primitive:NN \vfill                 \tex_vfill:D
\name_primitive:NN \vskip                 \tex_vskip:D
\name_primitive:NN \vss                   \tex_vss:D
\name_primitive:NN \unskip                \tex_unskip:D
\name_primitive:NN \kern                  \tex_kern:D
\name_primitive:NN \unkern                \tex_unkern:D
\name_primitive:NN \hrule                 \tex_hrule:D
\name_primitive:NN \vrule                 \tex_vrule:D
\name_primitive:NN \leaders               \tex_leaders:D
\name_primitive:NN \cleaders              \tex_cleaders:D
\name_primitive:NN \xleaders              \tex_xleaders:D
\name_primitive:NN \lastkern              \tex_lastkern:D
\name_primitive:NN \lastskip              \tex_lastskip:D
\name_primitive:NN \indent                \tex_indent:D
\name_primitive:NN \par                   \tex_par:D
\name_primitive:NN \noindent              \tex_noindent:D
\name_primitive:NN \vadjust               \tex_vadjust:D
\name_primitive:NN \baselineskip          \tex_baselineskip:D
\name_primitive:NN \lineskip              \tex_lineskip:D
\name_primitive:NN \lineskiplimit         \tex_lineskiplimit:D
\name_primitive:NN \clubpenalty           \tex_clubpenalty:D
\name_primitive:NN \widowpenalty          \tex_widowpenalty:D
\name_primitive:NN \exhyphenpenalty       \tex_exhyphenpenalty:D
\name_primitive:NN \hyphenpenalty         \tex_hyphenpenalty:D
\name_primitive:NN \linepenalty           \tex_linepenalty:D
\name_primitive:NN \doublehyphendemerits  \tex_doublehyphendemerits:D
\name_primitive:NN \finalhyphendemerits   \tex_finalhyphendemerits:D
\name_primitive:NN \adjdemerits           \tex_adjdemerits:D
\name_primitive:NN \hangafter             \tex_hangafter:D
\name_primitive:NN \hangindent            \tex_hangindent:D
\name_primitive:NN \parshape              \tex_parshape:D
\name_primitive:NN \hsize                 \tex_hsize:D
\name_primitive:NN \lefthyphenmin         \tex_lefthyphenmin:D
\name_primitive:NN \righthyphenmin        \tex_righthyphenmin:D
\name_primitive:NN \leftskip              \tex_leftskip:D
\name_primitive:NN \rightskip             \tex_rightskip:D
\name_primitive:NN \looseness             \tex_looseness:D
\name_primitive:NN \parskip               \tex_parskip:D
\name_primitive:NN \parindent             \tex_parindent:D
\name_primitive:NN \uchyph                \tex_uchyph:D
\name_primitive:NN \emergencystretch      \tex_emergencystretch:D
\name_primitive:NN \pretolerance          \tex_pretolerance:D
\name_primitive:NN \tolerance             \tex_tolerance:D
\name_primitive:NN \spaceskip             \tex_spaceskip:D
\name_primitive:NN \xspaceskip            \tex_xspaceskip:D
\name_primitive:NN \parfillskip           \tex_parfillskip:D
\name_primitive:NN \everypar              \tex_everypar:D
\name_primitive:NN \prevgraf              \tex_prevgraf:D
\name_primitive:NN \spacefactor           \tex_spacefactor:D
\name_primitive:NN \shipout               \tex_shipout:D
\name_primitive:NN \vsize                 \tex_vsize:D
\name_primitive:NN \interlinepenalty      \tex_interlinepenalty:D
\name_primitive:NN \brokenpenalty         \tex_brokenpenalty:D
\name_primitive:NN \topskip               \tex_topskip:D
\name_primitive:NN \maxdeadcycles         \tex_maxdeadcycles:D
\name_primitive:NN \maxdepth              \tex_maxdepth:D
\name_primitive:NN \output                \tex_output:D
\name_primitive:NN \deadcycles            \tex_deadcycles:D
\name_primitive:NN \pagedepth             \tex_pagedepth:D
\name_primitive:NN \pagestretch           \tex_pagestretch:D
\name_primitive:NN \pagefilstretch        \tex_pagefilstretch:D
\name_primitive:NN \pagefillstretch       \tex_pagefillstretch:D
\name_primitive:NN \pagefilllstretch      \tex_pagefilllstretch:D
\name_primitive:NN \pageshrink            \tex_pageshrink:D
\name_primitive:NN \pagegoal              \tex_pagegoal:D
\name_primitive:NN \pagetotal             \tex_pagetotal:D
\name_primitive:NN \outputpenalty         \tex_outputpenalty:D
\name_primitive:NN \hoffset               \tex_hoffset:D
\name_primitive:NN \voffset               \tex_voffset:D
\name_primitive:NN \insert                \tex_insert:D
\name_primitive:NN \holdinginserts        \tex_holdinginserts:D
\name_primitive:NN \floatingpenalty       \tex_floatingpenalty:D
\name_primitive:NN \insertpenalties       \tex_insertpenalties:D
\name_primitive:NN \lower                 \tex_lower:D
\name_primitive:NN \moveleft              \tex_moveleft:D
\name_primitive:NN \moveright             \tex_moveright:D
\name_primitive:NN \raise                 \tex_raise:D
\name_primitive:NN \copy                  \tex_copy:D
\name_primitive:NN \lastbox               \tex_lastbox:D
\name_primitive:NN \vsplit                \tex_vsplit:D
\name_primitive:NN \unhbox                \tex_unhbox:D
\name_primitive:NN \unhcopy               \tex_unhcopy:D
\name_primitive:NN \unvbox                \tex_unvbox:D
\name_primitive:NN \unvcopy               \tex_unvcopy:D
\name_primitive:NN \setbox                \tex_setbox:D
\name_primitive:NN \hbox                  \tex_hbox:D
\name_primitive:NN \vbox                  \tex_vbox:D
\name_primitive:NN \vtop                  \tex_vtop:D
\name_primitive:NN \prevdepth             \tex_prevdepth:D
\name_primitive:NN \badness               \tex_badness:D
\name_primitive:NN \hbadness              \tex_hbadness:D
\name_primitive:NN \vbadness              \tex_vbadness:D
\name_primitive:NN \hfuzz                 \tex_hfuzz:D
\name_primitive:NN \vfuzz                 \tex_vfuzz:D
\name_primitive:NN \overfullrule          \tex_overfullrule:D
\name_primitive:NN \boxmaxdepth           \tex_boxmaxdepth:D
\name_primitive:NN \splitmaxdepth         \tex_splitmaxdepth:D
\name_primitive:NN \splittopskip          \tex_splittopskip:D
\name_primitive:NN \everyhbox             \tex_everyhbox:D
\name_primitive:NN \everyvbox             \tex_everyvbox:D
\name_primitive:NN \nullfont              \tex_nullfont:D
\name_primitive:NN \textfont              \tex_textfont:D
\name_primitive:NN \scriptfont            \tex_scriptfont:D
\name_primitive:NN \scriptscriptfont      \tex_scriptscriptfont:D
\name_primitive:NN \fontdimen             \tex_fontdimen:D
\name_primitive:NN \hyphenchar            \tex_hyphenchar:D
\name_primitive:NN \skewchar              \tex_skewchar:D
\name_primitive:NN \defaulthyphenchar     \tex_defaulthyphenchar:D
\name_primitive:NN \defaultskewchar       \tex_defaultskewchar:D
\name_primitive:NN \number                \tex_number:D
\name_primitive:NN \romannumeral          \tex_romannumeral:D
\name_primitive:NN \string                \tex_string:D
\name_primitive:NN \lowercase             \tex_lowercase:D
\name_primitive:NN \uppercase             \tex_uppercase:D
\name_primitive:NN \meaning               \tex_meaning:D
\name_primitive:NN \penalty               \tex_penalty:D
\name_primitive:NN \unpenalty             \tex_unpenalty:D
\name_primitive:NN \lastpenalty           \tex_lastpenalty:D
\name_primitive:NN \special               \tex_special:D
\name_primitive:NN \dump                  \tex_dump:D
\name_primitive:NN \patterns              \tex_patterns:D
\name_primitive:NN \hyphenation           \tex_hyphenation:D
\name_primitive:NN \time                  \tex_time:D
\name_primitive:NN \day                   \tex_day:D
\name_primitive:NN \month                 \tex_month:D
\name_primitive:NN \year                  \tex_year:D
\name_primitive:NN \jobname               \tex_jobname:D
\name_primitive:NN \everyjob              \tex_everyjob:D
\name_primitive:NN \count                 \tex_count:D
\name_primitive:NN \dimen                 \tex_dimen:D
\name_primitive:NN \skip                  \tex_skip:D
\name_primitive:NN \toks                  \tex_toks:D
\name_primitive:NN \muskip                \tex_muskip:D
\name_primitive:NN \box                   \tex_box:D
\name_primitive:NN \wd                    \tex_wd:D
\name_primitive:NN \ht                    \tex_ht:D
\name_primitive:NN \dp                    \tex_dp:D
\name_primitive:NN \catcode               \tex_catcode:D
\name_primitive:NN \delcode               \tex_delcode:D
\name_primitive:NN \sfcode                \tex_sfcode:D
\name_primitive:NN \lccode                \tex_lccode:D
\name_primitive:NN \uccode                \tex_uccode:D
\name_primitive:NN \mathcode              \tex_mathcode:D
%    \end{macrocode}
%
%
%
%
% Since \LaTeX3 will require at least the \eTeX{} extensions,
% we also rename the additional primitives. These are all
% given the prefix |\etex_|.
%    \begin{macrocode}
\name_primitive:NN \ifdefined             \etex_ifdefined:D
\name_primitive:NN \ifcsname              \etex_ifcsname:D
\name_primitive:NN \unless                \etex_unless:D
\name_primitive:NN \eTeXversion           \etex_eTeXversion:D
\name_primitive:NN \eTeXrevision          \etex_eTeXrevision:D
\name_primitive:NN \marks                 \etex_marks:D
\name_primitive:NN \topmarks              \etex_topmarks:D
\name_primitive:NN \firstmarks            \etex_firstmarks:D
\name_primitive:NN \botmarks              \etex_botmarks:D
\name_primitive:NN \splitfirstmarks       \etex_splitfirstmarks:D
\name_primitive:NN \splitbotmarks         \etex_splitbotmarks:D
\name_primitive:NN \unexpanded            \etex_unexpanded:D
\name_primitive:NN \detokenize            \etex_detokenize:D
\name_primitive:NN \scantokens            \etex_scantokens:D
\name_primitive:NN \showtokens            \etex_showtokens:D
\name_primitive:NN \readline              \etex_readline:D
\name_primitive:NN \tracingassigns        \etex_tracingassigns:D
\name_primitive:NN \tracingscantokens     \etex_tracingscantokens:D
\name_primitive:NN \tracingnesting        \etex_tracingnesting:D
\name_primitive:NN \tracingifs            \etex_tracingifs:D
\name_primitive:NN \currentiflevel        \etex_currentiflevel:D
\name_primitive:NN \currentifbranch       \etex_currentifbranch:D
\name_primitive:NN \currentiftype         \etex_currentiftype:D
\name_primitive:NN \tracinggroups         \etex_tracinggroups:D
\name_primitive:NN \currentgrouplevel     \etex_currentgrouplevel:D
\name_primitive:NN \currentgrouptype      \etex_currentgrouptype:D
\name_primitive:NN \showgroups            \etex_showgroups:D
\name_primitive:NN \showifs               \etex_showifs:D
\name_primitive:NN \interactionmode       \etex_interactionmode:D
\name_primitive:NN \lastnodetype          \etex_lastnodetype:D
\name_primitive:NN \iffontchar            \etex_iffontchar:D
\name_primitive:NN \fontcharht            \etex_fontcharht:D
\name_primitive:NN \fontchardp            \etex_fontchardp:D
\name_primitive:NN \fontcharwd            \etex_fontcharwd:D
\name_primitive:NN \fontcharic            \etex_fontcharic:D
\name_primitive:NN \parshapeindent        \etex_parshapeindent:D
\name_primitive:NN \parshapelength        \etex_parshapelength:D
\name_primitive:NN \parshapedimen         \etex_parshapedimen:D
\name_primitive:NN \numexpr               \etex_numexpr:D
\name_primitive:NN \dimexpr               \etex_dimexpr:D
\name_primitive:NN \glueexpr              \etex_glueexpr:D
\name_primitive:NN \muexpr                \etex_muexpr:D
\name_primitive:NN \gluestretch           \etex_gluestretch:D
\name_primitive:NN \glueshrink            \etex_glueshrink:D
\name_primitive:NN \gluestretchorder      \etex_gluestretchorder:D
\name_primitive:NN \glueshrinkorder       \etex_glueshrinkorder:D
\name_primitive:NN \gluetomu              \etex_gluetomu:D
\name_primitive:NN \mutoglue              \etex_mutoglue:D
\name_primitive:NN \lastlinefit           \etex_lastlinefit:D
\name_primitive:NN \interlinepenalties    \etex_interlinepenalties:D
\name_primitive:NN \clubpenalties         \etex_clubpenalties:D
\name_primitive:NN \widowpenalties        \etex_widowpenalties:D
\name_primitive:NN \displaywidowpenalties \etex_displaywidowpenalties:D
\name_primitive:NN \middle                \etex_middle:D
\name_primitive:NN \savinghyphcodes       \etex_savinghyphcodes:D
\name_primitive:NN \savingvdiscards       \etex_savingvdiscards:D
\name_primitive:NN \pagediscards          \etex_pagediscards:D
\name_primitive:NN \splitdiscards         \etex_splitdiscards:D
\name_primitive:NN \TeXXETstate           \etex_TeXXETstate:D
\name_primitive:NN \beginL                \etex_beginL:D
\name_primitive:NN \endL                  \etex_endL:D
\name_primitive:NN \beginR                \etex_beginR:D
\name_primitive:NN \endR                  \etex_endR:D
\name_primitive:NN \predisplaydirection   \etex_predisplaydirection:D
\name_primitive:NN \everyeof              \etex_everyeof:D
\name_primitive:NN \protected             \etex_protected:D
%    \end{macrocode}
%
%
%    All major distributions\footnote{At the time of writing MiK\TeX\
%      does not but I have a gut feeling that will change.} use
%    pdf\eTeX{} as engine so we add these names as well. Since the
%    pdf\TeX{} team has been very good at prefixing most primitives
%    with |pdf| (so far only five do not start with |pdf|) we do not
%    give then a double |pdf| prefix. The list below covers pdf\TeX
%    v~1.30.4.
%    \begin{macrocode}
%% integer registers:
\name_primitive:NN \pdfoutput             \pdf_output:D
\name_primitive:NN \pdfminorversion       \pdf_minorversion:D
\name_primitive:NN \pdfcompresslevel      \pdf_compresslevel:D
\name_primitive:NN \pdfdecimaldigits      \pdf_decimaldigits:D
\name_primitive:NN \pdfimageresolution    \pdf_imageresolution:D
\name_primitive:NN \pdfpkresolution       \pdf_pkresolution:D
\name_primitive:NN \pdftracingfonts       \pdf_tracingfonts:D
\name_primitive:NN \pdfuniqueresname      \pdf_uniqueresname:D
\name_primitive:NN \pdfadjustspacing      \pdf_adjustspacing:D
\name_primitive:NN \pdfprotrudechars      \pdf_protrudechars:D
\name_primitive:NN \efcode                \pdf_efcode:D
\name_primitive:NN \lpcode                \pdf_lpcode:D
\name_primitive:NN \rpcode                \pdf_rpcode:D
\name_primitive:NN \pdfforcepagebox       \pdf_forcepagebox:D
\name_primitive:NN \pdfoptionalwaysusepdfpagebox \pdf_optionalwaysusepdfpagebox:D
\name_primitive:NN \pdfinclusionerrorlevel\pdf_inclusionerrorlevel:D
\name_primitive:NN \pdfoptionpdfinclusionerrorlevel \pdf_optionpdfinclusionerrorlevel:D
\name_primitive:NN \pdfimagehicolor       \pdf_imagehicolor:D
\name_primitive:NN \pdfimageapplygamma    \pdf_imageapplygamma:D
\name_primitive:NN \pdfgamma              \pdf_gamma:D
\name_primitive:NN \pdfimagegamma         \pdf_imagegamma:D
%% dimen registers:
\name_primitive:NN \pdfhorigin            \pdf_horigin:D
\name_primitive:NN \pdfvorigin            \pdf_vorigin:D
\name_primitive:NN \pdfpagewidth          \pdf_pagewidth:D
\name_primitive:NN \pdfpageheight         \pdf_pageheight:D
\name_primitive:NN \pdflinkmargin         \pdf_linkmargin:D
\name_primitive:NN \pdfdestmargin         \pdf_destmargin:D
\name_primitive:NN \pdfthreadmargin       \pdf_threadmargin:D
%% token registers:
\name_primitive:NN \pdfpagesattr          \pdf_pagesattr:D
\name_primitive:NN \pdfpageattr           \pdf_pageattr:D
\name_primitive:NN \pdfpageresources      \pdf_pageresources:D
\name_primitive:NN \pdfpkmode             \pdf_pkmode:D
%% expandable commands:
\name_primitive:NN \pdftexrevision        \pdf_texrevision:D
\name_primitive:NN \pdftexbanner          \pdf_texbanner:D
\name_primitive:NN \pdfcreationdate       \pdf_creationdate:D
\name_primitive:NN \pdfpageref            \pdf_pageref:D
\name_primitive:NN \pdfxformname          \pdf_xformname:D
\name_primitive:NN \pdffontname           \pdf_fontname:D
\name_primitive:NN \pdffontobjnum         \pdf_fontobjnum:D
\name_primitive:NN \pdffontsize           \pdf_fontsize:D
\name_primitive:NN \pdfincludechars       \pdf_includechars:D
\name_primitive:NN \leftmarginkern        \pdf_leftmarginkern:D
\name_primitive:NN \rightmarginkern       \pdf_rightmarginkern:D
\name_primitive:NN \pdfescapestring       \pdf_escapestring:D
\name_primitive:NN \pdfescapename         \pdf_escapename:D
\name_primitive:NN \pdfescapehex          \pdf_escapehex:D
\name_primitive:NN \pdfunescapehex        \pdf_unescapehex:D
\name_primitive:NN \pdfstrcmp             \pdf_strcmp:D
\name_primitive:NN \pdfuniformdeviate     \pdf_uniformdeviate:D
\name_primitive:NN \pdfnormaldeviate      \pdf_normaldeviate:D
\name_primitive:NN \pdfmdfivesum          \pdf_mdfivesum:D
\name_primitive:NN \pdffilemoddate        \pdf_filemoddate:D
\name_primitive:NN \pdffilesize           \pdf_filesize:D
\name_primitive:NN \pdffiledump           \pdf_filedump:D
%% read-only integers:
\name_primitive:NN \pdftexversion         \pdf_texversion:D
\name_primitive:NN \pdflastobj            \pdf_lastobj:D
\name_primitive:NN \pdflastxform          \pdf_lastxform:D
\name_primitive:NN \pdflastximage         \pdf_lastximage:D
\name_primitive:NN \pdflastximagepages    \pdf_lastximagepages:D
\name_primitive:NN \pdflastannot          \pdf_lastannot:D
\name_primitive:NN \pdflastxpos           \pdf_lastxpos:D
\name_primitive:NN \pdflastypos           \pdf_lastypos:D
\name_primitive:NN \pdflastdemerits       \pdf_lastdemerits:D
\name_primitive:NN \pdfelapsedtime        \pdf_elapsedtime:D
\name_primitive:NN \pdfrandomseed         \pdf_randomseed:D
\name_primitive:NN \pdfshellescape        \pdf_shellescape:D
%% general commands:
\name_primitive:NN \pdfobj                \pdf_obj:D 
\name_primitive:NN \pdfrefobj             \pdf_refobj:D 
\name_primitive:NN \pdfxform              \pdf_xform:D
\name_primitive:NN \pdfrefxform           \pdf_refxform:D  
\name_primitive:NN \pdfximage             \pdf_ximage:D
\name_primitive:NN \pdfrefximage          \pdf_refximage:D
\name_primitive:NN \pdfannot              \pdf_annot:D
\name_primitive:NN \pdfstartlink          \pdf_startlink:D    
\name_primitive:NN \pdfendlink            \pdf_endlink:D              
\name_primitive:NN \pdfoutline            \pdf_outline:D  
\name_primitive:NN \pdfdest               \pdf_dest:D
\name_primitive:NN \pdfthread             \pdf_thread:D
\name_primitive:NN \pdfstartthread        \pdf_startthread:D      
\name_primitive:NN \pdfendthread          \pdf_endthread:D      
\name_primitive:NN \pdfsavepos            \pdf_savepos:D      
\name_primitive:NN \pdfinfo               \pdf_info:D 
\name_primitive:NN \pdfcatalog            \pdf_catalog:D  
\name_primitive:NN \pdfnames              \pdf_names:D
\name_primitive:NN \pdfmapfile            \pdf_mapfile:D  
\name_primitive:NN \pdfmapline            \pdf_mapline:D  
\name_primitive:NN \pdffontattr           \pdf_fontattr:D   
\name_primitive:NN \pdftrailer            \pdf_trailer:D  
\name_primitive:NN \pdffontexpand         \pdf_fontexpand:D
%%\name_primitive:NN \vadjust [<pre spec>] <filler> { <vertical mode material> } (h, m)
\name_primitive:NN \pdfliteral            \pdf_literal:D
%%\name_primitive:NN \special <pdfspecial spec>
\name_primitive:NN \pdfresettimer         \pdf_resettimer:D    
\name_primitive:NN \pdfsetrandomseed      \pdf_setrandomseed:D        
\name_primitive:NN \pdfnoligatures        \pdf_noligatures:D      
%    \end{macrocode}
%
% What about Omega and Aleph? The status of both are unclear but let's
% start by adding a single primitive which we can use for testing if
% we have one of these engines.
%    \begin{macrocode}
\name_primitive:NN \textdir             \aleph_textdir:D
%    \end{macrocode}
%  \begin{macro}{\CodeStart}
%  \begin{macro}{\CodeStop}
%    Here we define functions that are used to turn on and off the
%    special conventions used in the kernel of \LaTeX3.
%
%    First of all, the space, tab and the return characters will all be
%    ignored inside \LaTeX3 code. When space characters are needed in
%    \LaTeX3 code the |~| character will be used for that purpose.
%
%    \begin{macrocode}
\tex_def:D\CodeStart{%
    \tex_catcode:D `\ =9\tex_relax:D
    \tex_catcode:D `\^^M=9\tex_relax:D
    \tex_catcode:D `\^^I=9\tex_relax:D
    \tex_catcode:D `\~=10\tex_relax:D
%<!initex>    \tex_catcode:D `\@=11\tex_relax:D % For LaTeX2e
    \tex_catcode:D `\_=11\tex_relax:D
    \tex_catcode:D `\:=11\tex_relax:D}
%    \end{macrocode}
%
%    \begin{macrocode}
\tex_def:D\CodeStop{
    \tex_catcode:D `\ =10\tex_relax:D
    \tex_catcode:D `\^^M=5\tex_relax:D
    \tex_catcode:D `\^^I=10\tex_relax:D
    \tex_catcode:D `\~=13\tex_relax:D
%<!initex>    \tex_catcode:D `\@=12\tex_relax:D  % For LaTeX2e
    \tex_catcode:D `\_=8\tex_relax:D
    \tex_catcode:D `\:=12\tex_relax:D}
%</initex|package>
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\NamesStart}
%  \begin{macro}{\NamesStop}
%    Sometimes we need to be able to use names from the kernel of
%    \LaTeX3 without adhering it's conventions according to space
%    characters. These macros provide the necessary settings.
%    \begin{macrocode}
\tex_def:D \NamesStart{
  \tex_catcode:D `\_=11\scan_stop:
  \tex_catcode:D `\:=11\scan_stop:
  }
\tex_def:D \NamesStop{
  \tex_catcode:D `\_=8\scan_stop:
  \tex_catcode:D `\:=12\scan_stop:
  }
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%    \begin{macrocode}
%<*initex>
\tex_def:D\GetIdInfo{\CodeStop\GetIdInfoAux}
\tex_def:D\GetIdInfoAux$#1~#2.dtx~#3~#4-#5-#6~#7~#8$#9{%
  \tex_immediate:D\tex_write:D-1{#2;~v#3,~#4/#5/#6;~#9}%
  \CodeStart
}
%</initex>
%    \end{macrocode}
%
% Finally some corrections in the case we are running over \LaTeXe.
%
% Every single experimental package should start by doing something
% like this:
% \begin{verbatim}
% \RequirePackage{l3names}
% \GetIdInfo$Id: l3names.dtx 577 2006-11-21 18:10:26Z morten $
%           {L3 Experimental sequences and stacks}
% \end{verbatim}
% \emph{OR}
% \begin{verbatim}
% \RequirePackage{l3names}
% \CodeStart
% \end{verbatim}
% Since we have to make |\GetIdInfo| stop the special catcode regime
% when reading the package in order to get the information extracted
% correctly, we might as well use it to also issue |\CodeStart|. This
% also means that we automatically get |\CodeStart| issued at the
% beginning of every package without tampering with |\ProvidesPackage|
% which can cause problems when using these experimental packages with
% code relying on characters having traditional catcodes, noticeably
% the catcode of the space character. We cannot simply use the code
% from the top of this file since it contains a call to |\def| which
% may not exist at this point.
%    \begin{macrocode}
%<*package>
\tex_def:D\GetIdInfo{\CodeStop\GetIdInfoAux}
\tex_def:D\GetIdInfoAux$#1~#2.dtx~#3~#4-#5-#6~#7~#8$#9{%
  \tex_def:D \fileversion{#3}%
  \tex_def:D \filedate{#4/#5/#6}%
  \ProvidesPackage{#2}[#4/#5/#6~ v#3~ #9]%
  \CodeStart
}
%    \end{macrocode}
%
% A few of the `primitives' assigned above have already been stolen
% by \LaTeX, so assign them by hand to the saved real primitive.
%    \begin{macrocode}
\tex_let:D\tex_input:D        \@@input
\tex_let:D\tex_underline:D    \@@underline
\tex_let:D\tex_end:D          \@@end
\tex_let:D\tex_everymath:D    \frozen@everymath
\tex_let:D\tex_everydisplay:D \frozen@everydisplay
\tex_let:D\tex_italiccor:D    \@@italiccorr
\tex_let:D\tex_hyphen:D       \@@hyph
%    \end{macrocode}
%
% \TeX\ has a nasty habit of inserting a command with the name |\par|
% so we had better make sure that that command at least has a definition.
%    \begin{macrocode}
\tex_let:D\par          \tex_par:D
%    \end{macrocode}
%
%
%
%    \begin{macrocode}
\tex_ifx:D\name_undefine:N\@gobble
%    \end{macrocode}
%
% Normally just set the catcodes, and let \LaTeXe\ handle the
% package stack. If \LaTeXe\ resets @ reset the white space as well.
%    \begin{macrocode}
  \tex_def:D\name_pop_stack:w{}
  \g@addto@macro\@popfilename{%
    \tex_ifnum:D12=\tex_the:D\tex_catcode:D`@
      \CodeStop
    \tex_fi:D}
%    \end{macrocode}
%
%    \begin{macrocode}
\tex_else:D
%    \end{macrocode}
%
% But if traditional \TeX\ code is disabled, do this\ldots
%
% As mentioned above, The \LaTeXe\ package mechanism will insert some code
% to handle the filename stack, and reset the package options, this
% code will die if the \TeX\ primitives have gone, so skip past it
% and insert some equivalent code that will work.
%
% First a version of |\ProvidesPackage| that can cope.
%    \begin{macrocode}
\tex_def:D\ProvidesPackage{
  \tex_begingroup:D
  \CodeStop
  \package_provides:w}
%    \end{macrocode}
%
%    \begin{macrocode}
\tex_def:D\package_provides:w#1#2[#3]{
  \tex_endgroup:D
  \tex_immediate:D\tex_write:D-1{Package:~#1#2~#3}
  \tex_expandafter:D\tex_xdef:D
    \tex_csname:D ver@#1.sty\tex_endcsname:D{#1}}
%    \end{macrocode}
%
% In this case the catcode preserving stack is not maintained and
% |\CodeStart| conventions stay in force once on. You'll need
% to turn then off explicitly with |\CodeStop| (although as currently
% built on 2e, nothing except very experimental code will run in
% this mode!) Also note that |\RequirePackage| is a simple definition, just for
% one file, with no options.
%    \begin{macrocode}
\tex_def:D\name_pop_stack:w#1\relax{%
  \CodeStop
  \tex_expandafter:D\@p@pfilename\@currnamestack\@nil
  \tex_let:D\default@ds\@unknownoptionerror
  \tex_global:D\tex_let:D\ds@\@empty
  \tex_global:D\tex_let:D\@declaredoptions\@empty}
%    \end{macrocode}
%
%    \begin{macrocode}
\tex_def:D\@p@pfilename#1#2#3#4\@nil{%
  \tex_gdef:D\@currname{#1}%
  \tex_gdef:D\@currext{#2}%
  \tex_catcode:D`\@#3%
  \tex_gdef:D\@currnamestack{#4}}
%    \end{macrocode}
%
%    \begin{macrocode}
  \tex_def:D\NeedsTeXFormat#1{}
  \tex_def:D\RequirePackage#1{
    \tex_expandafter:D\tex_ifx:D
      \tex_csname:D ver@#1.sty\tex_endcsname:D\tex_relax:D
        \CodeStart
        \tex_input:D#1.sty\tex_relax:D
    \tex_fi:D}
\tex_fi:D
%    \end{macrocode}
%
%
% The |\futurelet| just forces the special end of file marker to vanish,
% so the argument of |\name_pop_stack:w| does not cause an end-of-file
% error. (Normally I use |\expandafter| for this trick, but here the next
% token is in fact |\let| and that may be undefined.)
%    \begin{macrocode}
\tex_futurelet:D\name_tmp:\name_pop_stack:w
%</package>
%    \end{macrocode}
%
% \endinput
%
%  $Log$
%  Revision 1.17  2006/01/15 07:55:48  morten
%  Fixed minor typo
%
%  Revision 1.16  2006/01/15 07:17:43  morten
%  Imported \NamesStart and \NamesStop from l3messages.
%
%  Revision 1.15  2005/12/27 10:00:03  morten
%  Changed RCS information retrieval, code to run as package under 2e
%  changed slightly to not set special catcodes directly.
%
%  Revision 1.14  2005/12/01 22:58:16  morten
%  Added pdfTeX primitives
%
%  Revision 1.13  2005/03/26 21:04:19  morten
%  Fix typo.
%
%  Revision 1.12  2005/03/22 23:23:57  morten
%  Added an Aleph primitive
%
%  Revision 1.11  2005/03/15 23:16:21  braams
%  Some tweaking with the docstrip guards to get the documentation to
%  come out right.
%
%  Revision 1.10  2005/03/15 22:48:31  braams
%  Made it possible to load this as the very first file with initex
%
%  Revision 1.9  2005/03/11 21:29:56  braams
%  Fixed the use of RCS information; moved definition of \eTeX
%  to l3doc.cls
%
