diff options
author | Karl Berry <karl@freefriends.org> | 2009-11-22 00:01:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-11-22 00:01:52 +0000 |
commit | c8f25e8c064910cbdae63d68ad0b753dcd925264 (patch) | |
tree | 50cd44cf48c386388aadae1d16b1adae5f917034 /Master/texmf-dist/source | |
parent | 3a4d88244a662af906112c56eb1982f9dacef5b2 (diff) |
expl3 1733 (21nov09)
git-svn-id: svn://tug.org/texlive/trunk@16114 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
20 files changed, 1054 insertions, 1180 deletions
diff --git a/Master/texmf-dist/source/latex/expl3/expl3.dtx b/Master/texmf-dist/source/latex/expl3/expl3.dtx index ec89c31aea3..2ffb707a1bc 100644 --- a/Master/texmf-dist/source/latex/expl3/expl3.dtx +++ b/Master/texmf-dist/source/latex/expl3/expl3.dtx @@ -37,7 +37,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: expl3.dtx 1458 2009-08-12 03:35:07Z will $ +\GetIdInfo$Id: expl3.dtx 1677 2009-11-02 08:24:04Z joseph $ {L3 Experimental code bundle wrapper}% %\iffalse %<*driver> @@ -740,24 +740,23 @@ % availble in the \pkg{xparse} package, which is available from CTAN % or the \LaTeX3 SVN repository. % \item At an internal level, most functions should be generated -% \cs{long} (using \cs{cs_new:Nn}) rather than `short' (using -% \cs{cs_new_nopar:Nn}). The exceptions are: +% \cs{long} (using \cs{cs_new:Npn}) rather than `short' (using +% \cs{cs_new_nopar:Npn}). The exceptions are: % \begin{itemize} % \item Functions which take no arguments; % \item Functions which are used with pre-set arguments which % therefore cannot be \cs{long}: this is mainly the case with -% auxilliary functions. +% auxiliary functions. % \end{itemize} % \item Where possible, declare all variables and functions (using -% \cs{cs_new:NN}, \cs{tl_new:N}, etc.) before use. +% \cs{cs_new:Npn}, \cs{tl_new:N}, etc.) before use. % \item Prefer `higher-level' functions over `lower-level', where -% possible. So for example use \cs{cs_new:Nn} in preference to -% \cs{cs_new:Npn}, and \cs{cs_if_exist:N(TF)} over +% possible. So for example use \cs{cs_if_exist:N(TF)} over % \cs{if_cs_exist:N}. -% \item Use space to make code readable. In general, we recommand +% \item Use space to make code readable. In general, we recommend % a layout such as: % \begin{verbatim} -% \cs_new:Nn \foo_bar:Nn { +% \cs_new:Npn \foo_bar:Nn #1#2 { % \cs_if_exist:NTF #1 { % \foo_bar_aux_i:n {#2} % }{ diff --git a/Master/texmf-dist/source/latex/expl3/l3.ins b/Master/texmf-dist/source/latex/expl3/l3.ins deleted file mode 100644 index 41fa0184129..00000000000 --- a/Master/texmf-dist/source/latex/expl3/l3.ins +++ /dev/null @@ -1,119 +0,0 @@ - -\input docstrip.tex -\askforoverwritefalse - -\preamble - - -EXPERIMENTAL CODE - -Do not distribute this file without also distributing the -source files specified above. - -Do not distribute a modified version of this file. - - -\endpreamble -% stop docstrip adding \endinput -\postamble -\endpostamble - -\keepsilent - -% wrapper package for the expl3 bundle -\generate{\file{expl3.sty}{\from{expl3.dtx}{package}}} - - -% l3names.sty sets up the naming scheme for TeX primitives. -\generate{\file{l3names.sty}{\from{l3names.dtx}{package}}} - - - -% Define some basic commands to get us started with the new -% programming style. -\generate{\file{l3basics.sty}{\from{l3basics.dtx}{package,trace}}} - - -% Define some basic commands that check various conditions -% related to defining commands eg defined/undefined global/local -% Not sure how much of this really makes sense as a package, but... -\generate{\file{l3chk.sty}{\from{l3chk.dtx}{package,trace}}} - - -%% toks register handling (can be compiled with check module) -\generate{\file{l3toks.sty}{\from{l3toks.dtx}{package,trace}}} - - -%% token lists -\generate{\file{l3tl.sty}{\from{l3tl.dtx}{package,trace}}} - - -%% LaTeX3 expansion module -\generate{\file{l3expan.sty}{\from{l3expan.dtx}{package,trace}}} - - -%% LaTeX3 quarks. -\generate{\file{l3quark.sty}{\from{l3quark.dtx}{package,trace}}} - - -%% LaTeX3 sequences. -\generate{\file{l3seq.sty}{\from{l3seq.dtx}{package,trace}}} - - -%% LaTeX3 clists. -\generate{\file{l3clist.sty}{\from{l3clist.dtx}{package,trace}}} - - -%% LaTeX3 property lists. -\generate{\file{l3prop.sty}{\from{l3prop.dtx}{package,trace}}} - - -%% LaTeX3 integer registers. (can be compiled with check module) -\generate{\file{l3int.sty}{\from{l3int.dtx}{package,trace}}} - - -%% LaTeX3 fake integer macros. -\generate{\file{l3num.sty}{\from{l3num.dtx}{package,trace}}} - -%% LaTeX3 integer expressions. -\generate{\file{l3intexpr.sty}{\from{l3intexpr.dtx}{package,trace}}} - - -%% LaTeX3 skip registers. -\generate{\file{l3skip.sty}{\from{l3skip.dtx}{package,trace}}} - - -%% LaTeX3 precompilation -\generate{\file{l3precom.sty}{\from{l3precom.dtx}{package,precompile,trace}}} - -%% LaTeX3 I/O module. -\generate{\file{l3io.sty}{\from{l3io.dtx}{package,trace}}} - -%% LaTeX3 program control structures (loops, booleans, ...) -\generate{\file{l3prg.sty}{\from{l3prg.dtx}{package}}} - -%% LaTeX3 box module -\generate{\file{l3box.sty}{\from{l3box.dtx}{package}}} - -%% LaTeX3 messages -\generate{\file{l3msg.sty}{\from{l3msg.dtx}{package}}} - -%% LaTeX3 tokens -\generate{\file{l3token.sty}{\from{l3token.dtx}{package}}} - -%% LaTeX3 cross references -\generate{\file{l3xref.sty}{\from{l3xref.dtx}{package}}} -%%\generate{\file{l3xref-test.tex}{\from{l3xref.dtx}{testfile}}} - -%% LaTeX3 calc module -\generate{\file{l3calc.sty}{\from{l3calc.dtx}{package}}} - -%% LaTeX3 keyval modules -\generate{\file{l3keyval.sty}{\from{l3keyval.dtx}{package}}} -\generate{\file{l3keys.sty}{\from{l3keys.dtx}{package}}} - -%% LaTeX3 file loading -\generate{\file{l3file.sty}{\from{l3file.dtx}{package}}} - - -\endbatchfile diff --git a/Master/texmf-dist/source/latex/expl3/l3basics.dtx b/Master/texmf-dist/source/latex/expl3/l3basics.dtx index 56132002658..f49489bd17f 100644 --- a/Master/texmf-dist/source/latex/expl3/l3basics.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3basics.dtx @@ -35,7 +35,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3basics.dtx 1453 2009-08-08 14:38:49Z joseph $ +\GetIdInfo$Id: l3basics.dtx 1700 2009-11-04 21:15:58Z joseph $ {L3 Experimental basic definitions} %\iffalse %<*driver> @@ -325,7 +325,10 @@ % internally and not expected to be widely used. (For now, anyway.) % \end{function} % -% \begin{function}{ \chk_if_free_cs:N } +% \begin{function}{ +% \chk_if_free_cs:N| +% \chk_if_free_cs:c +% } % \begin{syntax} % "\chk_if_free_cs:N" <cs> % \end{syntax} @@ -2372,6 +2375,7 @@ % \end{macro} % % \begin{macro}{\chk_if_free_cs:N} +% \begin{macro}{\chk_if_free_cs:c} % This command is called by |\cs_new_nopar:Npn| and |\cs_new_eq:NN| etc.\ % to make sure that the argument sequence is not already in use. If % it is, an error is signalled. It checks if \m{csname} is @@ -2394,8 +2398,10 @@ line~\tex_the:D \tex_inputlineno:D} %</trace> } +\cs_set_nopar:Npn \chk_if_free_cs:c { \exp_args:Nc \chk_if_free_cs:N } % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\chk_if_exist_cs:N } % \begin{macro}{\chk_if_exist_cs:c } diff --git a/Master/texmf-dist/source/latex/expl3/l3candidates.dtx b/Master/texmf-dist/source/latex/expl3/l3candidates.dtx new file mode 100644 index 00000000000..63385cbcd41 --- /dev/null +++ b/Master/texmf-dist/source/latex/expl3/l3candidates.dtx @@ -0,0 +1,381 @@ +% \iffalse +%% File: l3extra.dtx Copyright (C) 2005-2009 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/svnroot/experimental/trunk/ +%% +%% 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. +%% +%% ----------------------------------------------------------------------- +% +%<*driver|package> +\RequirePackage{expl3} +%</driver|package> +%\fi +\errorcontextlines=999 +\GetIdInfo$Id$ + {L3 Experimental 'extras' module} +%\iffalse +%<*driver> +%\fi +\ProvidesFile{\filename.\filenameext} + [\filedate\space v\fileversion\space\filedescription] +%\iffalse +\documentclass[full]{l3doc} +\begin{document} +\DocInput{l3extra.dtx} +\end{document} +%</driver> +% \fi +% +% +% \title{The \textsf{l3extra} package\thanks{This file +% has version number \fileversion, last +% revised \filedate.}} +% \author{\Team} +% \date{\filedate} +% \maketitle +% +% \begin{documentation} +% +% \section{Intro} +% +% This \emph{experimental} package contains additions to the \pkg{expl3} +% programming language before they're added to the `official' packages. +% The functions defined within will fall into three categories: +% \begin{itemize} +% \item Will be added directly to a corresponding \pkg{expl3} module at some stage. +% \item Will be re-worked and added to a module with slightly different name or behaviour. +% \item Will eventually vanish. +% \end{itemize} +% Beware, then, that loading this package and using its contents may cause your +% code to break down the track. +% +% \section{Functions for functions} +% +% +% \begin{function}{\exp_arg:x} +% \begin{syntax} +% "\exp_arg:x" \Arg{text} +% \end{syntax} +% Fully expands <text> before passing it to the input stream. +% Not expandable. +% \begin{texnote} +% In pdf\TeX\ 1.5 and Lua\TeX, this can be done expandably with "\expanded". +% \end{texnote} +% \end{function} +% +% +% \section{Functions for token lists} +% +% \begin{function}{\tl_trim_spaces:n|\tl_trim_spaces:N} +% \begin{syntax} +% |\tl_trim_spaces:n|~|{|<token list>|}| +% |\tl_trim_spaces:n|~|{|\verb*| |<token list>\verb*| ||}| +% |\tl_trim_spaces:N| <tl var.> +% \end{syntax} +% After a full expansion, |\tl_trim_space:n| returns <token list> stripped +% of any preceeding and trailing spaces. +% For example, to set a token list variable to a trim-spaced argument, +% use something like this: +% \begin{verbatim} +% \tl_set:Nx \l_tmpa_tl { \tl_trim_spaces:n {#1} } +% \end{verbatim} +% |\tl_trim_spaces:N| removes preceeding and trailing spaces from the +% contents of its token list variable argument. +% \end{function} +% +% +% \begin{function}{\tl_transform:nn|\char_transform:NN} +% \begin{syntax} +% |\tl_transform:nn| \Arg{tranformation rules} \Arg{token list} +% "\char_transform:NN" <char.\ token1> <char.\ token2> +% \end{syntax} +% Tokenises and evaluates <token list> according to the transformation rules +% given in the first argument. +% These transformation rules may be function/variable +% redefinitions, catcode changes (see "\char_make_other:N" and so on), or +% token transformations given by "\char_transform:NN". +% +% "\char_transform:NN" declares that within the <token list> argument, +% any occurences of <token1> are interpreted as if they were <token2> albeit +% with the same catcode as <token1>. +% +% Note 1: Everything evaluated by this function occurs within a group; +% global definitions will be necessary to make changes outside of it. +% +% Note 2: Because this function must be invoked before its arguments are +% tokenised, it cannot be evaluated within another macro (unless clever use +% of "\tl_rescan:nn" is employed). +% \begin{texnote} +% This is a wrapper around \TeX's "\lowercase" primitive and only the ASCII +% uppercase letters are protected from being transformed themselves. +% If you are using Xe\TeX\ or Lua\TeX, be careful of unicode letters that will +% be affected by this process. +% \end{texnote} +% \end{function} +% +% \section{Functions for sequences} +% +% +% \begin{function}{\seq_mapthread_function:NNN} +% \begin{syntax} +% "\seq_mapthread_function:NNN" <seq1> <seq2> <function> +% \end{syntax} +% Applies to <function> as arguments each pair of +% corresponding elements within <seq1> and <seq2> (which must have the same +% number of elements). +% +% For example, if "\l_mya_seq" contains "a", "b", "c" and +% "\l_myb_seq" contains "x", "y", "z", then +% \begin{verbatim} +% \seq_mapthread_function:NNN \l_mya_seq \l_myb_seq \my_func:nn +% \end{verbatim} +% is the same as executing +% \begin{verbatim} +% \my_func:nn {a} {x} +% \my_func:nn {b} {y} +% \my_func:nn {c} {z} +% \end{verbatim} +% \end{function} +% +% +% \begin{function}{\seq_get_length:NN} +% \begin{syntax} +% |\seq_get_length:NN| <seq> <int> +% \end{syntax} +% Sets <int> to the number of elements in <seq>. +% \end{function} +% +% +% \begin{function}{\seq_set_from_clist:NN|\seq_set_from_clist:Nn| +% \seq_gset_from_clist:NN|\seq_gset_from_clist:Nn} +% \begin{syntax} +% "\seq_set_from_seq:Nn" <seq> \Arg{clist} +% "\seq_set_from_seq:NN" <seq> <clist variable> +% \end{syntax} +% Transforms comma-list <clist> into sequence <seq>. +% \end{function} +% +% +% \section{Functions for comma-lists} +% +% \begin{function}{\clist_set_from_seq:NN|\clist_gset_from_seq:NN} +% \begin{syntax} +% "\clist_set_from_seq:NN" <clist> <seq> +% \end{syntax} +% Transforms sequence <seq> into comma-list variable <clist>. +% \end{function} +% +% +% +% \end{documentation} +% +% \begin{implementation} +% +% \section{Implementation} +% +% +% \begin{macrocode} +%<*package> +\ProvidesExplPackage + {\filename}{\filedate}{\fileversion}{\filedescription} +\package_check_loaded_expl: +%</package> +%<*initex|package> +% \end{macrocode} +% +% \begin{macro}{\exp_arg:x} +% \begin{macrocode} +\cs_new:Npn \exp_arg:x #1 + { + \group_begin: + \cs_set:Npx \cs_tmp: {#1} + \exp_args:wN + \group_end: + \cs_tmp: + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\tl_trim_spaces:n,\tl_trim_spaces:N} +% \begin{macrocode} +\cs_new:Npn \tl_trim_spaces:n #1 { + \exp_not:n \exp_after:wN \exp_after:wN \exp_after:wN + { \tl_trim_spaces_exp:n {#1} } +} +\cs_new:Npn \tl_trim_spaces:N #1 { + \tl_set:Nx #1 { \exp_after:wN \tl_trim_spaces:n \exp_after:wN {#1} } +} +% \end{macrocode} +% +% \begin{macrocode} +\char_make_math_shift:N \Q +\cs_new:Npn \tl_trim_spaces_exp:n #1 { + \tex_romannumeral:D -`\q \tl_trim_spaces_aux_i:w \exp_not:N #1 Q~Q +} +\cs_new:Npn \tl_trim_spaces_aux_i:w #1~Q { \tl_trim_spaces_aux_ii:w #1 Q } +\cs_new:Npn \tl_trim_spaces_aux_ii:w #1 Q #2 {#1} +\char_make_letter:N \Q +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\tl_transform:nn,\char_transform:NN} +% \begin{macrocode} +\cs_new:Npn \tl_transform:nn #1 + { + \group_begin: + \tl_map_function:nN + { \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z } + \char_protect_uppercase:N + \cs_set_eq:NN \char_transform:NN \char_transform_hidden:NN + #1 + \tl_transform_aux:n + } +% \end{macrocode} +% Allow for catcode changes: +% \begin{macrocode} +\cs_new:Npn \tl_transform_aux:n #1 + { + \tl_to_lowercase:n { \group_end: #1 } + } +\cs_set:Npn \char_protect_uppercase:N #1 + { + \char_set_lccode:nn {`#1} {`#1} + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_new:Npn \char_transform_hidden:NN #1#2 + { + \char_set_lccode:nn {`#1} {`#2} + } +\cs_new:Npn \char_transform:NN + { + \msg_error:nn {l3extra} {naked-char-transform} + } +\msg_new:nnn {l3extra} {naked-char-transform} + { + This command can only appear within the first\\ + argument of \string\tl_transform:nn. + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\seq_mapthread_function:NNN} +% \begin{macrocode} +\seq_new:N \l_tmpb_seq +% \end{macrocode} +% +% +% \begin{macro}{\seq_get_length:NN} +% \begin{macrocode} +\cs_new:Nn \seq_get_length:NN { + \int_zero:N #1 + \seq_map_inline:Nn #2 { \int_incr:N #1} +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\cs_new:Nn \seq_mapthread_function:NNN { + \seq_get_length:NN \l_tmpa_int #1 + \seq_get_length:NN \l_tmpb_int #2 + \intexpr_compare:nTF { \l_tmpa_int == \l_tmpb_int }{ + \seq_set_eq:NN \l_tmpa_seq #1 + \seq_set_eq:NN \l_tmpb_seq #2 + \prg_stepwise_inline:nnnn{1}{1}{\l_tmpa_int}{ + \seq_pop:NN \l_tmpa_seq \l_tmpa_tl + \seq_pop:NN \l_tmpb_seq \l_tmpb_tl + \exp_args:NVV #3 \l_tmpa_tl \l_tmpb_tl + } + }{\ERROR} +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\seq_set_from_clist:Nn,\seq_set_from_clist:NN} +% \begin{macro}{\seq_gset_from_clist:Nn,\seq_gset_from_clist:NN} +% \begin{macrocode} +\cs_set:Npn \seq_set_from_clist:Nn #1#2 { + \seq_clear:N #1 + \clist_map_inline:nn {#2} { \seq_put_right:Nn #1 {##1} } +} +\cs_set:Npn \seq_set_from_clist:NN #1#2 { + \seq_clear:N #1 + \clist_map_inline:Nn #2 { \seq_put_right:Nn #1 {##1} } +} +\cs_set:Npn \seq_gset_from_clist:Nn #1#2 { + \seq_gclear:N #1 + \clist_map_inline:nn {#2} { \seq_gput_right:Nn #1 {##1} } +} +\cs_set:Npn \seq_gset_from_clist:NN #1#2 { + \seq_gclear:N #1 + \clist_map_inline:Nn #2 { \seq_gput_right:Nn #1 {##1} } +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% +% \begin{macro}{\clist_set_from_seq:NN,\clist_gset_from_seq:NN} +% I assume this technique is more efficient than looping through each element +% and using "\clist_put_right:Nn" (Will). +% \begin{macrocode} +\cs_new:Npn \clist_set_from_seq_aux:NNN #1#2#3 { + \cs_set:Npn \seq_elt:w ##1 \seq_elt_end: ##2 { + \exp_not:n {##1} + \quark_if_nil:NF ##2 { , ##2 } + } + #1 #2 { #3 \q_nil } +} +\cs_new:Npn \clist_set_from_seq:NN { \clist_set_from_seq_aux:NNN \tl_set:Nx } +\cs_new:Npn \clist_gset_from_seq:NN { \clist_set_from_seq_aux:NNN \tl_gset:Nx } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</initex|package> +% \end{macrocode} +% +% \begin{macrocode} +%<*showmemory> +\showMemUsage +%</showmemory> +% \end{macrocode} +% +% \end{implementation} +% +% \PrintIndex +% +% \endinput diff --git a/Master/texmf-dist/source/latex/expl3/l3clist.dtx b/Master/texmf-dist/source/latex/expl3/l3clist.dtx index adf2e659ba5..0f6276b47d2 100644 --- a/Master/texmf-dist/source/latex/expl3/l3clist.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3clist.dtx @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3clist.dtx 1441 2009-08-05 19:23:23Z joseph $ +\GetIdInfo$Id: l3clist.dtx 1713 2009-11-06 07:02:42Z will $ {L3 Experimental comma separated lists} %\iffalse %<*driver> @@ -144,12 +144,6 @@ % \end{function} % % -% \begin{function}{\clist_set_from_seq:NN|\clist_gset_from_seq:NN} -% \begin{syntax} -% "\clist_set_from_seq:NN" <clist> <seq> -% \end{syntax} -% Transforms sequence <seq> into comma-list variable <clist>. -% \end{function} % % % \section{Putting data in} @@ -603,22 +597,6 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\clist_set_from_seq:NN,\clist_gset_from_seq:NN} -% I hope this technique is more efficient than looping through each element -% and using "\clist_put_right:Nn" (Will). -% \begin{macrocode} -\cs_new:Npn \clist_set_from_seq_aux:NNN #1#2#3 { - \cs_set:Npn \seq_elt:w ##1 \seq_elt_end: ##2 { - \exp_not:n {##1} - \quark_if_nil:NF ##2 { , ##2 } - } - #1 #2 { #3 \q_nil } -} -\cs_new:Npn \clist_set_from_seq:NN { \clist_set_from_seq_aux:NNN \tl_set:Nx } -\cs_new:Npn \clist_gset_from_seq:NN { \clist_set_from_seq_aux:NNN \tl_gset:Nx } -% \end{macrocode} -% \end{macro} -% % \subsection{Predicates and conditionals} % % \begin{macro}{\clist_if_empty_p:N,\clist_if_empty_p:c} @@ -1077,12 +1055,12 @@ % from left to right. For each element check if the element is % already present in the list. % \begin{macrocode} -\cs_new:Nn \clist_remove_duplicates_aux:NN { +\cs_new:Npn \clist_remove_duplicates_aux:NN #1#2 { \clist_clear:N \l_clist_remove_clist \clist_map_function:NN #2 \clist_remove_duplicates_aux:n #1 #2 \l_clist_remove_clist } -\cs_new:Nn \clist_remove_duplicates_aux:n { +\cs_new:Npn \clist_remove_duplicates_aux:n #1 { \clist_if_in:NnF \l_clist_remove_clist {#1} { \clist_put_right:Nn \l_clist_remove_clist {#1} } @@ -1116,9 +1094,9 @@ \cs_new_nopar:Npn \clist_gremove_element:Nn { \clist_remove_element_aux:NNn \clist_gset_eq:NN } -\cs_new:Nn \clist_remove_element_aux:NNn { +\cs_new:Npn \clist_remove_element_aux:NNn #1#2#3 { \clist_clear:N \l_clist_remove_clist - \cs_set:Nn \clist_remove_element_aux:n { + \cs_set:Npn \clist_remove_element_aux:n ##1 { \tl_if_eq:nnF {#3} {##1} { \clist_put_right:Nn \l_clist_remove_clist {##1} } @@ -1126,7 +1104,7 @@ \clist_map_function:NN #2 \clist_remove_element_aux:n #1 #2 \l_clist_remove_clist } -\cs_new:Nn \clist_remove_element_aux:n { } +\cs_new:Npn \clist_remove_element_aux:n #1 { } % \end{macrocode} %\end{macro} %\end{macro} diff --git a/Master/texmf-dist/source/latex/expl3/l3doc.dtx b/Master/texmf-dist/source/latex/expl3/l3doc.dtx index 197a6703a98..e4238752c4d 100644 --- a/Master/texmf-dist/source/latex/expl3/l3doc.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3doc.dtx @@ -77,7 +77,7 @@ Do not distribute a modified version of this file. % \end{macrocode} % %<*driver|class> -\GetIdInfo$Id: l3doc.dtx 1538 2009-09-17 05:14:09Z will $ +\GetIdInfo$Id: l3doc.dtx 1733 2009-11-08 06:24:26Z will $ {L3 Experimental documentation class} %</driver|class> % @@ -216,6 +216,22 @@ Do not distribute a modified version of this file. % % \section{Documentation} % +% \subsection{Configuration} +% +% Before class options are processed, \pkg{l3doc} loads a configuration +% file "l3doc.cfg" if it exists, allowing you to customise the behaviour of +% the class without having to change the documentation source files. +% +% For example, to produce documentation on letter-sized paper instead of the +% default A4 size, create |l3doc.cfg| and include the line +% \begin{verbatim} +% \PassOptionsToClass{letterpaper}{l3doc} +% \end{verbatim} +% +% By default, \pkg{l3doc} selects the |T1| font encoding and loads the +% Latin Modern fonts. +% To prevent this, use the class option |cm-default|. +% % \subsection{Partitioning documentation and implementation} % % \pkg{doc} uses the "\OnlyDocumentation"/"\AlsoImplementation" macros @@ -398,7 +414,7 @@ Do not distribute a modified version of this file. Javier~Bezos,~Will~Robertson,~Joseph~Wright}} % \end{macrocode} % -% \subsection{Options} +% \subsection{Options and configuration} % % \begin{macrocode} \DeclareOption{a5paper}{\@latexerr{Option not supported}{}} @@ -406,21 +422,43 @@ Do not distribute a modified version of this file. % % \begin{macrocode} \bool_new:N \g_doc_full_bool -\bool_set_false:N \g_doc_full_bool +\bool_new:N \g_doc_lmodern_bool +\bool_new:N \g_doc_checkfunc_bool +% \end{macrocode} +% +% \begin{macrocode} \DeclareOption{full}{ \bool_set_true:N \g_doc_full_bool } \DeclareOption{onlydoc}{ \bool_set_false:N \g_doc_full_bool } % \end{macrocode} % % \begin{macrocode} -\bool_new:N \g_doc_checkfunc_bool -\bool_set_true:N \g_doc_checkfunc_bool \DeclareOption{check}{ \bool_set_true:N \g_doc_checkfunc_bool } \DeclareOption{nocheck}{ \bool_set_false:N \g_doc_checkfunc_bool } % \end{macrocode} % % \begin{macrocode} +\DeclareOption{cm-default}{ \bool_set_false:N \g_doc_lmodern_bool } +\DeclareOption{lm-default}{ \bool_set_true:N \g_doc_lmodern_bool } +% \end{macrocode} +% +% \begin{macrocode} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} -\ExecuteOptions{full} +\ExecuteOptions{full,a4paper,nocheck,lm-default} +% \end{macrocode} +% +% Input a local configuration file, if it exists. +% +% \begin{macrocode} +\InputIfFileExists{l3doc.cfg} + { + \typeout{*************************************^^J + *~Local~config~file~l3doc.cfg~used ^^J + *************************************} + } + { \@input{l3doc.ltx} } +% \end{macrocode} +% +% \begin{macrocode} \ProcessOptions % \end{macrocode} % @@ -428,14 +466,19 @@ Do not distribute a modified version of this file. % \subsection{Class and package loading} % % \begin{macrocode} -\LoadClass[a4paper]{article} +\LoadClass{article} \RequirePackage{doc} -\RequirePackage{array,alphalph,color,fixltx2e,enumitem,trace,underscore} +\RequirePackage{array,alphalph,color,fixltx2e,enumitem,textcomp,trace,underscore} % \end{macrocode} -% +% +% \begin{macrocode} +\bool_if:NT \g_doc_lmodern_bool { + \RequirePackage[T1]{fontenc} + \RequirePackage{lmodern} +} +% \end{macrocode} +% % \begin{macrocode} -\RequirePackage[T1]{fontenc} -\RequirePackage{lmodern,textcomp} \RequirePackage{hypdoc} % \end{macrocode} % Just want the "comment" environment from \pkg{verbatim}: @@ -988,7 +1031,7 @@ Do not distribute a modified version of this file. \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage} } \index{ - #1\actualchar{\protect\ttfamily#1} (option) + #1\actualchar{\protect\ttfamily#1}~(option) \encapchar usage } \index{ @@ -1057,7 +1100,7 @@ Do not distribute a modified version of this file. % % \begin{macrocode} \newenvironment{TemplateInterfaceDescription}[1] - {\subsection{The~template~type~`#1'}% + {\subsection{The~object~type~`#1'}% \begingroup \@beginparpenalty\@M \description @@ -1070,7 +1113,7 @@ Do not distribute a modified version of this file. % % \begin{macrocode} \newenvironment{TemplateDescription}[2] - {\subsection{The~template~`#2'~(type~#1)}% + {\subsection{The~template~`#2'~(object~type~#1)}% \subsubsection*{Attributes:}% \begingroup \@beginparpenalty\@M @@ -1346,7 +1389,6 @@ Do not distribute a modified version of this file. % \begin{macrocode} \g@addto@macro\theindex{\MakePrivateLetters} \cs_set:Npn \verbatimchar {&} -\cs_set:Npx \levelchar {\string#} % \end{macrocode} % % \begin{macrocode} @@ -1508,14 +1550,6 @@ Do not distribute a modified version of this file. } % \end{macrocode} % -% Input a local configuration file, if it exists. -% \begin{macrocode} -\InputIfFileExists{l3doc.cfg}{ - \typeout{*************************************^^J - *~Local~config~file~l3doc.cfg~used ^^J - *************************************} -}{} -% \end{macrocode} % % \begin{macrocode} %</class> diff --git a/Master/texmf-dist/source/latex/expl3/l3expan.dtx b/Master/texmf-dist/source/latex/expl3/l3expan.dtx index a3f116a47a1..617e3f27572 100644 --- a/Master/texmf-dist/source/latex/expl3/l3expan.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3expan.dtx @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3expan.dtx 1464 2009-08-16 11:02:19Z joseph $ +\GetIdInfo$Id: l3expan.dtx 1673 2009-11-02 05:40:42Z will $ {L3 Experimental Argument Expansion module} %\iffalse %<*driver> @@ -210,14 +210,20 @@ % try to finish any "\if... \fi:" itself! % % -% When pdf\TeX\ 1.50 arrives, it will contain a primitive for -% performing the equivalent of an "x" expansion after only one -% expansion and most importantly: as an expandable operation. % \begin{function}{\exp_arg:x} % \begin{syntax} % "\exp_arg:x" \Arg{arg} % \end{syntax} % <arg> is expanded fully using an "x" expansion. +% +% When pdf\TeX\ 1.50 arrives, it will contain a primitive for +% performing the equivalent of an "x" expansion after only one +% expansion and most importantly: as an expandable operation. +% +% However, we will not be using the expandable command "\expanded" +% until it is broadly available; note that as of \TeX~Live~2009, +% only Lua\TeX\ supports this primitive. Until further notice, +% "\exp_arg:x" will remain \emph{unexpandable}. % \end{function} % % @@ -672,21 +678,23 @@ % \end{macro} % % \begin{macro}{\::x,\exp_arg:x} -% This function is used to expand an argument fully. If the -% pdf\TeX\ primitive "\expanded" is present, we use it. +% This function is used to expand an argument fully. +% We could use the new expandable primitive "\expanded" here, but we +% don't want to create incompatibilities between engines. % \begin{macrocode} -\cs_new_eq:NN \exp_arg:x \expanded % Move eventually. -\cs_if_free:NTF\exp_arg:x{ - \cs_new:Npn\::x#1\:::#2#3{ - \cs_set_nopar:Npx \l_exp_tl{{#3}} - \exp_after:wN\exp_arg_next:nnn\l_exp_tl{#1}{#2}} -} -{ - \cs_new:Npn\::x#1\:::#2#3{ - \exp_after:wN\exp_arg_next:nnn - \exp_after:wN{\exp_arg:x{{#3}}}{#1}{#2} +%%\cs_new_eq:NN \exp_arg:x \expanded % Move eventually. +%%\cs_if_free:NTF\exp_arg:x{ + \cs_new:Npn \::x #1 \::: #2#3 { + \cs_set_nopar:Npx \l_exp_tl {{#3}} + \exp_after:wN \exp_arg_next:nnn \l_exp_tl {#1}{#2} } -} +%%} +%%{ +%% \cs_new:Npn\::x#1\:::#2#3{ +%% \exp_after:wN\exp_arg_next:nnn +%% \exp_after:wN{\exp_arg:x{#3}}{#1}{#2} +%% } +%%} % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/expl3/l3file.dtx b/Master/texmf-dist/source/latex/expl3/l3file.dtx index e5e3a5e159c..951ee5e8df6 100644 --- a/Master/texmf-dist/source/latex/expl3/l3file.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3file.dtx @@ -37,7 +37,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3file.dtx 1352 2009-05-28 11:50:39Z morten $ +\GetIdInfo$Id: l3file.dtx 1676 2009-11-02 08:18:16Z will $ {L3 Experimental file loading} %\iffalse %<*driver> @@ -247,9 +247,9 @@ \prg_return_true: } } -\cs_new_nopar:Nn \file_if_exist_path:n { +\cs_new_nopar:Npn \file_if_exist_path:n #1 { \bool_set_false:N \l_file_tmp_bool - \cs_set_nopar:Nn \file_if_exist_aux:n { + \cs_set_nopar:Npn \file_if_exist_aux:n ##1 { \ior_open:Nn \l_file_test_read_stream { #1 ##1 } \ior_if_eof:NF \l_file_test_read_stream { \bool_set_true:N \l_file_tmp_bool @@ -271,7 +271,7 @@ \prg_return_false: } } -\cs_new_nopar:Nn \file_if_exist_aux:n { } +\cs_new_nopar:Npn \file_if_exist_aux:n #1 { } % \end{macrocode} %\end{macro} %\end{macro} @@ -285,7 +285,7 @@ % a simple check ``here''. If that fails, then there is a loop over % the current search path. % \begin{macrocode} -\cs_new_nopar:Nn \file_add_path:nN { +\cs_new_nopar:Npn \file_add_path:nN #1#2 { \tl_clear:N #2 \ior_open:Nn \l_file_test_read_stream {#1} \ior_if_eof:NTF \l_file_test_read_stream { @@ -295,8 +295,8 @@ } \ior_close:N \l_file_test_read_stream } -\cs_new_nopar:Nn \file_add_path_search:nN { - \cs_set_nopar:Nn \file_add_path_aux:n { +\cs_new_nopar:Npn \file_add_path_search:nN #1#2 { + \cs_set_nopar:Npn \file_add_path_aux:n ##1 { \ior_open:Nn \l_file_test_read_stream { ##1 #1 } \ior_if_eof:NF \l_file_test_read_stream { \tl_set:Nn #2 { ##1 #1 } @@ -312,7 +312,7 @@ %<*initex|package> \clist_map_function:NN \l_file_search_path_clist \file_add_path_aux:n } -\cs_new_nopar:Nn \file_add_path_aux:n { } +\cs_new_nopar:Npn \file_add_path_aux:n #1 { } % \end{macrocode} %\end{macro} %\end{macro} @@ -324,13 +324,13 @@ % file is not found. This is used rather than \cs{file_if_exist:nT} here % as it saves running the same loop twice. % \begin{macrocode} -\cs_new:Nn \file_input:n { +\cs_new:Npn \file_input:n #1 { \file_add_path:nN {#1} \l_file_tmp_tl \tl_if_empty:NF \l_file_tmp_tl { \file_input_no_check:n \l_file_tmp_tl } } -\cs_new:Nn \file_input_no_record:n { +\cs_new:Npn \file_input_no_record:n #1 { \file_add_path:nN {#1} \l_file_tmp_tl \tl_if_empty:NF \l_file_tmp_tl { \file_input_no_check_no_record:n \l_file_tmp_tl @@ -343,7 +343,7 @@ %\begin{macro}{\file_input_no_check:n} % File input records what is going on before setting to work. % \begin{macrocode} -\cs_new_nopar:Nn \file_input_no_check:n { +\cs_new_nopar:Npn \file_input_no_check:n #1 { \clist_gput_right:Nx \g_file_record_clist {#1} \wlog{ADDING: #1} %</initex|package> @@ -360,7 +360,7 @@ % Inputting a file without adding to the main record is basically the % same: even in this case the file goes on the full log. % \begin{macrocode} -\cs_new_nopar:Nn \file_input_no_check_no_record:n { +\cs_new_nopar:Npn \file_input_no_check_no_record:n #1 { \clist_gput_right:Nx \g_file_record_full_clist {#1} \tex_input:D #1 ~ } @@ -374,19 +374,19 @@ % version includes everything whereas the standard version uses the % shorter record. % \begin{macrocode} -\cs_new_nopar:Nn \file_list: { +\cs_new_nopar:Npn \file_list: { \file_list:N \g_file_record_clist } -\cs_new_nopar:Nn \file_list_full: { +\cs_new_nopar:Npn \file_list_full: { \file_list:N \g_file_record_full_clist } -\cs_new_nopar:Nn \file_list:N { +\cs_new_nopar:Npn \file_list:N #1 { \clist_remove_duplicates:N #1 \iow_log:x { *~File~List~* } \clist_map_function:NN #1 \file_list_aux:n \iow_log:x { ************* } } -\cs_new_nopar:Nn \file_list_aux:n { +\cs_new_nopar:Npn \file_list_aux:n #1 { \iow_log:x { #1 } } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/expl3/l3final.dtx b/Master/texmf-dist/source/latex/expl3/l3final.dtx index d4ece607fee..b9f61d473b2 100644 --- a/Master/texmf-dist/source/latex/expl3/l3final.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3final.dtx @@ -37,7 +37,7 @@ %</driver|package> %<*-ini> %\fi -\GetIdInfo$Id: l3final.dtx 1452 2009-08-08 14:09:32Z joseph $ +\GetIdInfo$Id: l3final.dtx 1670 2009-11-01 22:34:54Z will $ {L3 Experimental final module} %\iffalse %</-ini> @@ -53,10 +53,10 @@ %</driver> %\fi % -%\section{Final Wrap-up} +%\section{Finalising \textsf{expl3}} % -% This module will contain all the last minute coding necessary to round -% off the format. +% This module is the end of \pkg{expl3}, and finishes off the +% format. It also contains the loading code for the rest of \LaTeX3. % %\begin{function}{\par} % \begin{syntax} @@ -74,6 +74,16 @@ % undefines itself (as it can only every be used once). %\end{function} % +%\subsection{Higher-level \LaTeX3} +% +% Here, the rest of \LaTeX3 is loaded in a `chain'. +% \begin{macrocode} +\clist_map_inline:nn { + xparse , + xtemplate , +} { \file_input_no_record:n { #1 .ltx } } +% \end{macrocode} +% %\subsection{Dumping the format} % %\begin{macro}{\par} @@ -111,7 +121,7 @@ % starts with user category codes, \cs{ExplSyntaxOff} is called along % with tokenizing \cs{tex_dump:D} before actually calling it. % \begin{macrocode} -\cs_new_nopar:Nn \latex_format_dump: { +\cs_new_nopar:Npn \latex_format_dump: { \ExplSyntaxOff \cs_gundefine:N \latex_format_dump: \tex_dump:D diff --git a/Master/texmf-dist/source/latex/expl3/l3format.ins b/Master/texmf-dist/source/latex/expl3/l3format.ins deleted file mode 100644 index 3a850a79ef7..00000000000 --- a/Master/texmf-dist/source/latex/expl3/l3format.ins +++ /dev/null @@ -1,76 +0,0 @@ - -\input docstrip.tex -\askforoverwritefalse - -\preamble - - -EXPERIMENTAL CODE - -Do not distribute this file without also distributing the -source files specified above. - -Do not distribute a modified version of this file. - - -\endpreamble -% stop docstrip adding \endinput -\postamble -\endpostamble - -\keepsilent - -% generate the format file -\generate{% - \file{latex3.ltx}{% - \from{l3names.dtx}{initex} % The naming conventions - \from{l3basics.dtx}{initex} % Initialisations - \from{l3expan.dtx}{initex} % Controlling expansion of arguments - \from{l3tl.dtx}{initex} % token list variables - \from{l3num.dtx}{initex} % Storing integers in macros - \from{l3intexpr.dtx}{initex} % - \from{l3quark.dtx}{initex} % quarks - \from{l3seq.dtx}{initex} % Sequences and stacks -% - \from{l3alloc.dtx}{initex} % Register allocations -% - \from{l3toks.dtx}{initex} % dealing with token registers - \from{l3int.dtx}{initex} % dealing with integer registers - \from{l3prg.dtx}{initex} % Program control structures - \from{l3clist.dtx}{initex} % Comma separated lists - \from{l3token.dtx}{initex} % token investigation - \from{l3io.dtx}{initex} % dealing with I/O - \from{l3prop.dtx}{initex} % property lists - \from{l3msg.dtx}{initex} % setting up for user communication - \from{l3skip.dtx}{initex} % dealing with skip registers - \from{l3box.dtx}{initex} % dealing with box registers - \from{l3keyval.dtx}{initex} % - \from{l3keys.dtx}{initex} % -% -% \from{l3precom.dtx}{initex,precompile} % -% - \from{l3calc.dtx}{initex} % - \from{l3xref.dtx}{initex} % Cross references - \from{l3file.dtx}{initex} % file loading -% - \from{l3vers.dtx}{initex} % Version information -% -% -% \from{l3chk.dtx}{initex} % Checking functions -% - \from{l3final.dtx}{initex} % Final wrap-up - } -} - -\Msg{} -\Msg{*************************************} -\Msg{*} -\Msg{* Now run (PDF)INITEX on lbase.ltx} -\Msg{*} -\Msg{* On an up to date system, run } -\Msg{* pdftex -ini -etex *latex3.ltx } -\Msg{*} -\Msg{*************************************} -\Msg{} - -\endbatchfile diff --git a/Master/texmf-dist/source/latex/expl3/l3int.dtx b/Master/texmf-dist/source/latex/expl3/l3int.dtx index 815f7610e9c..8b61ae04eab 100644 --- a/Master/texmf-dist/source/latex/expl3/l3int.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3int.dtx @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3int.dtx 1362 2009-05-28 20:19:21Z joseph $ +\GetIdInfo$Id: l3int.dtx 1621 2009-10-25 06:36:19Z will $ {L3 Experimental Integer module} %\iffalse %<*driver> @@ -1188,6 +1188,11 @@ % \end{macrocode} % \end{macro} % +% Needed from the tl module: +% \begin{macrocode} +\int_new:N \g_tl_inline_level_int +% \end{macrocode} +% % \begin{macrocode} %</initex|package> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/expl3/l3io.dtx b/Master/texmf-dist/source/latex/expl3/l3io.dtx index 6473c2dca8b..a1223daaa6f 100644 --- a/Master/texmf-dist/source/latex/expl3/l3io.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3io.dtx @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3io.dtx 1369 2009-05-31 21:36:35Z joseph $ +\GetIdInfo$Id: l3io.dtx 1668 2009-11-01 22:13:36Z will $ {L3 Experimental i/o module} %\iffalse %<*driver> @@ -531,7 +531,7 @@ % \begin{macro}{\iow_char:N} % Function to write any escaped char to an output stream. % \begin{macrocode} -\cs_new:Nn \iow_char:N { \cs_to_str:N #1 } +\cs_new:Npn \iow_char:N #1 { \cs_to_str:N #1 } % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/expl3/l3keys.dtx b/Master/texmf-dist/source/latex/expl3/l3keys.dtx index e11a6907042..dc5b77f5c9b 100644 --- a/Master/texmf-dist/source/latex/expl3/l3keys.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3keys.dtx @@ -35,7 +35,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3keys.dtx 1542 2009-09-17 07:38:53Z joseph $ +\GetIdInfo$Id: l3keys.dtx 1716 2009-11-06 08:56:23Z joseph $ {L3 Experimental key-value support} %\iffalse %<*driver> @@ -364,14 +364,18 @@ % \keys_define:nn { module } { % key .choice_code:n = { % You~gave~choice~``\l_keys_choice_tl'',~ -% which~is~in~position~\l_keys_choice_int -% \~in~the~list. +% which~is~in~position~ +% \int_use:N\l_keys_choice_int\space +% in~the~list. % }, % key .generate_choices:n = { % choice-a, choice-b, choice-c % } % } %\end{verbatim} +% Following common computing practice, \cs{l_keys_choice_int} starts +% from $0$ for the first choice. This means that it can be used +% directly with \cs{if_case:w} and so on. % %\begin{variable}{ % \l_keys_choice_tl| @@ -389,7 +393,7 @@ % defining sub-keys. %\begin{verbatim} % \keys_define:nn { module } { -% key choices:n, +% key .choice:n, % key / choice-a .code:n = code-a, % key / choice-b .code:n = code-b, % key / choice-c .code:n = code-c, @@ -567,11 +571,15 @@ % Separates <key> from <property>. %\end{function} % -%\begin{function}{\keys_property_new:nn} +%\begin{function}{ +% \keys_property_new:nn | +% \keys_property_new_arg:nn +%} % \begin{syntax} % "\keys_property_new:nn" \Arg{property} \Arg{code} % \end{syntax} -% Makes a new <property> expanding to <code> +% Makes a new <property> expanding to <code>. The \texttt{arg} +% version makes properties with one argument. %\end{function} % %\begin{function}{\keys_property_undefine:n} @@ -768,7 +776,7 @@ %\begin{macro}{\keys_bool_set:NN} % Boolean keys are really just choices, but all done by hand. % \begin{macrocode} -\cs_new_nopar:Nn \keys_bool_set:NN { +\cs_new_nopar:Npn \keys_bool_set:NN #1#2 { \keys_cmd_set:nx { \l_keys_path_tl / true } { \exp_not:c { bool_ #2 set_true:N } \exp_not:N #1 @@ -791,7 +799,7 @@ % The code for making multiple choices is stored in a token list as there should % not be any |#| tokens. % \begin{macrocode} -\cs_new:Nn \keys_choice_code_store:x { +\cs_new:Npn \keys_choice_code_store:x #1 { \tl_set:cx { \c_keys_root_tl \l_keys_path_tl .choice_code_tl } {#1} } % \end{macrocode} @@ -802,7 +810,7 @@ % if that fails call the unknown key. That will exist, as it is created % when a choice is first made. So there is no need for any escape code. % \begin{macrocode} -\cs_new_nopar:Nn \keys_choice_find:n { +\cs_new_nopar:Npn \keys_choice_find:n #1 { \keys_execute_aux:nn { \l_keys_path_tl / #1 } { \keys_execute_aux:nn { \l_keys_path_tl / unknown } { } } @@ -814,13 +822,13 @@ % To make a choice from a key, two steps: set the code, and set the % unknown key. % \begin{macrocode} -\cs_new_nopar:Nn \keys_choice_make: { +\cs_new_nopar:Npn \keys_choice_make: { \keys_cmd_set:nn { \l_keys_path_tl } { \keys_choice_find:n {##1} } \keys_cmd_set:nn { \l_keys_path_tl / unknown } { - \msg_kernel_error:nxx { key-choice-unknown } { \l_keys_path_tl } - {##1} + \msg_kernel_error:nnxx { keys } { choice-unknown } + { \l_keys_path_tl } {##1} } } % \end{macrocode} @@ -831,7 +839,7 @@ % Creating multiple-choices means setting up the ``indicator'' code, % then applying whatever the user wanted. % \begin{macrocode} -\cs_new:Nn \keys_choices_generate:n { +\cs_new:Npn \keys_choices_generate:n #1 { \keys_choice_make: \int_zero:N \l_keys_choice_int \cs_if_exist:cTF { @@ -841,18 +849,19 @@ \c_keys_root_tl \l_keys_path_tl .choice_code_tl } }{ - \tl_clear:N \l_keys_choice_code_tl + \msg_kernel_error:nnx { keys } { generate-choices-before-code } + { \l_keys_path_tl } } \clist_map_function:nN {#1} \keys_choices_generate_aux:n } -\cs_new_nopar:Nn \keys_choices_generate_aux:n { - \int_incr:N \l_keys_choice_int +\cs_new_nopar:Npn \keys_choices_generate_aux:n #1 { \keys_cmd_set:nx { \l_keys_path_tl / #1 } { \exp_not:n { \tl_set:Nn \l_keys_choice_tl } {#1} \exp_not:n { \int_set:Nn \l_keys_choice_int } { \int_use:N \l_keys_choice_int } \exp_not:V \l_keys_choice_code_tl } + \int_incr:N \l_keys_choice_int } % \end{macrocode} %\end{macro} @@ -864,17 +873,17 @@ % Creating a new command means setting properties and then creating % a function with the correct number of arguments. % \begin{macrocode} -\cs_new:Nn \keys_cmd_set:nn { +\cs_new:Npn \keys_cmd_set:nn #1#2 { \keys_cmd_set_aux:n {#1} \cs_generate_from_arg_count:cNnn { \c_keys_root_tl #1 .cmd:n } \cs_set:Npn 1 {#2} } -\cs_new:Nn \keys_cmd_set:nx { +\cs_new:Npn \keys_cmd_set:nx #1#2 { \keys_cmd_set_aux:n {#1} \cs_generate_from_arg_count:cNnn { \c_keys_root_tl #1 .cmd:n } \cs_set:Npx 1 {#2} } -\cs_new_nopar:Nn \keys_cmd_set_aux:n { +\cs_new_nopar:Npn \keys_cmd_set_aux:n #1 { \keys_property_undefine:n { #1 .default_tl } \tl_set:cn { \c_keys_root_tl #1 .req_tl } { } } @@ -887,7 +896,7 @@ %\begin{macro}{\keys_default_set:V} % Setting a default value is easy. % \begin{macrocode} -\cs_new:Nn \keys_default_set:n { +\cs_new:Npn \keys_default_set:n #1 { \tl_set:cn { \c_keys_root_tl \l_keys_path_tl .default_tl } {#1} } \cs_generate_variant:Nn \keys_default_set:n { V } @@ -899,7 +908,7 @@ % The main key-defining function mainly sets up things for \pkg{l3keyval} % to use. % \begin{macrocode} -\cs_new:Nn \keys_define:nn { +\cs_new:Npn \keys_define:nn #1#2 { \tl_set:Nn \l_keys_module_tl {#1} \cs_set_eq:NN \KV_key_no_value_elt:n \keys_define_elt:n \cs_set_eq:NN \KV_key_value_elt:nn \keys_define_elt:nn @@ -919,11 +928,11 @@ %\begin{macro}{\keys_define_elt:nn} % The element processors for defining keys. % \begin{macrocode} -\cs_new_nopar:Nn \keys_define_elt:n { +\cs_new_nopar:Npn \keys_define_elt:n #1 { \bool_set_true:N \l_keys_no_value_bool \keys_define_elt_aux:nn {#1} { } } -\cs_new:Nn \keys_define_elt:nn { +\cs_new:Npn \keys_define_elt:nn #1#2 { \bool_set_false:N \l_keys_no_value_bool \keys_define_elt_aux:nn {#1} {#2} } @@ -933,15 +942,15 @@ %\begin{macro}[aux]{\keys_define_elt_aux:nn} % The auxiliary function does most of the work. % \begin{macrocode} -\cs_new:Nn \keys_define_elt_aux:nn { +\cs_new:Npn \keys_define_elt_aux:nn #1#2 { \keys_property_find:n {#1} \cs_set_eq:Nc \keys_tmp:w { \c_keys_properties_root_tl \l_keys_property_tl } \cs_if_exist:NTF \keys_tmp:w { \keys_define_key:n {#2} }{ - \msg_kernel_error:nx { key-property-unknown } - { \l_keys_property_tl } + \msg_kernel_error:nnxx { keys } { property-unknown } + { \l_keys_property_tl } { \l_keys_path_tl } } } % \end{macrocode} @@ -953,7 +962,7 @@ % can be made for required values without needing anything set % explicitly. % \begin{macrocode} -\cs_new:Nn \keys_define_key:n { +\cs_new:Npn \keys_define_key:n #1 { \bool_if:NTF \l_keys_no_value_bool { \intexpr_compare:nTF { \exp_args:Nc \cs_get_arg_count_from_signature:N @@ -961,8 +970,8 @@ } { \keys_tmp:w }{ - \msg_kernel_error:nx { key-property-value-required } - { \l_keys_property_tl } + \msg_kernel_error:nnxx { key } { property-requires-value } + { \l_keys_property_tl } { \l_keys_path_tl } } }{ \keys_tmp:w {#1} @@ -978,14 +987,15 @@ % key itself, then look for the \texttt{unknown} key with the same % path. If both of these fail, complain! % \begin{macrocode} -\cs_new_nopar:Nn \keys_execute: { +\cs_new_nopar:Npn \keys_execute: { \keys_execute_aux:nn { \l_keys_path_tl } { \keys_execute_unknown: } } -\cs_new_nopar:Nn \keys_execute_unknown: { +\cs_new_nopar:Npn \keys_execute_unknown: { \keys_execute_aux:nn { \l_keys_module_tl / unknown } { - \msg_kernel_error:nx { key-unknown } { \l_keys_path_tl } + \msg_kernel_error:nnxx { keys } { key-unknown } { \l_keys_path_tl } + { \l_keys_module_tl } } } % \end{macrocode} @@ -996,7 +1006,7 @@ % do not run away (hence the nine empty groups), but that the module % can clean up the spare groups at the end of executing the key. % \begin{macrocode} -\cs_new_nopar:Nn \keys_execute_aux:nn { +\cs_new_nopar:Npn \keys_execute_aux:nn #1#2 { \cs_set_eq:Nc \keys_tmp:w { \c_keys_root_tl #1 .cmd:n } \cs_if_exist:NTF \keys_tmp:w { \exp_args:NV \keys_tmp:w \l_keys_value_toks @@ -1039,7 +1049,7 @@ %\begin{macro}{\keys_meta_make:x} % To create a met-key, simply set up to pass data through. % \begin{macrocode} -\cs_new_nopar:Nn \keys_meta_make:n { +\cs_new_nopar:Npn \keys_meta_make:n #1 { \keys_cmd_set:nx { \l_keys_path_tl } { \exp_not:N \keys_set:nn { \l_keys_module_tl } {#1} } @@ -1055,19 +1065,19 @@ % Searching for a property means finding the last ``\texttt{.}'' in % the input, and storing the text before and after it. % \begin{macrocode} -\cs_new_nopar:Nn \keys_property_find:n { +\cs_new_nopar:Npn \keys_property_find:n #1 { \tl_set:Nx \l_keys_path_tl { \l_keys_module_tl / } \tl_if_in:nnTF {#1} {.} { \keys_property_find_aux:n {#1} }{ - \msg_kernel_error:nx { key-no-property } { #1 } + \msg_kernel_error:nnx { keys } { key-no-property } {#1} } } -\cs_new_nopar:Nn \keys_property_find_aux:n { +\cs_new_nopar:Npn \keys_property_find_aux:n #1 { \keys_property_find_aux:w #1 \q_stop } \cs_new_nopar:Npn \keys_property_find_aux:w #1 . #2 \q_stop { - \tl_if_in:nnTF {#2} {.} { + \tl_if_in:nnTF {#2} { . } { \tl_set:Nx \l_keys_path_tl { \l_keys_path_tl \tl_to_str:n {#1} . } @@ -1083,19 +1093,24 @@ %\end{macro} % %\begin{macro}{\keys_property_new:nn} +%\begin{macro}{\keys_property_new_arg:nn} % Creating a new property is simply a case of making the correctly-named % function. % \begin{macrocode} -\cs_new_nopar:Nn \keys_property_new:nn { - \cs_new:cn { \c_keys_properties_root_tl #1 } {#2} +\cs_new_nopar:Npn \keys_property_new:nn #1#2 { + \cs_new:cpn { \c_keys_properties_root_tl #1 } {#2} +} +\cs_new_nopar:Npn \keys_property_new_arg:nn #1#2 { + \cs_new:cpn { \c_keys_properties_root_tl #1 } ##1 {#2} } % \end{macrocode} %\end{macro} +%\end{macro} % %\begin{macro}{\keys_property_undefine:n} % Removing a property means undefining it. % \begin{macrocode} -\cs_new_nopar:Nn \keys_property_undefine:n { +\cs_new_nopar:Npn \keys_property_undefine:n #1 { \cs_set_eq:cN { \c_keys_root_tl #1 } \c_undefined } % \end{macrocode} @@ -1107,7 +1122,7 @@ % The main setting function just does the set up to get \pkg{l3keyval} % to do the hard work. % \begin{macrocode} -\cs_new:Nn \keys_set:nn { +\cs_new:Npn \keys_set:nn #1#2 { \tl_set:Nn \l_keys_module_tl {#1} \cs_set_eq:NN \KV_key_no_value_elt:n \keys_set_elt:n \cs_set_eq:NN \KV_key_value_elt:nn \keys_set_elt:nn @@ -1131,11 +1146,11 @@ % The two element processors are almost identical, and pass the data % through to the underlying auxiliary, which does the work. % \begin{macrocode} -\cs_new_nopar:Nn \keys_set_elt:n { +\cs_new_nopar:Npn \keys_set_elt:n #1 { \bool_set_true:N \l_keys_no_value_bool \keys_set_elt_aux:nn {#1} { } } -\cs_new:Nn \keys_set_elt:nn { +\cs_new:Npn \keys_set_elt:nn #1#2 { \bool_set_false:N \l_keys_no_value_bool \keys_set_elt_aux:nn {#1} {#2} } @@ -1148,13 +1163,14 @@ % then checks to see if the a value is required or forbidden. If % everything passes, move on to execute the code. % \begin{macrocode} -\cs_new:Nn \keys_set_elt_aux:nn { +\cs_new:Npn \keys_set_elt_aux:nn #1#2 { \tl_set:Nx \l_keys_key_tl { \tl_to_str:n {#1} } \tl_set:Nx \l_keys_path_tl { \l_keys_module_tl / \l_keys_key_tl } \keys_value_or_default:n {#2} \keys_if_value_requirement:nTF { required } { \bool_if:NTF \l_keys_no_value_bool { - \msg_kernel_error:nx { key-value-required } { \l_keys_path_tl } + \msg_kernel_error:nnx { keys } { value-required } + { \l_keys_path_tl } }{ \keys_set_elt_aux: } @@ -1162,13 +1178,13 @@ \keys_set_elt_aux: } } -\cs_new_nopar:Nn \keys_set_elt_aux: { +\cs_new_nopar:Npn \keys_set_elt_aux: { \keys_if_value_requirement:nTF { forbidden } { \bool_if:NTF \l_keys_no_value_bool { \keys_execute: }{ - \msg_kernel_error:nxx { key-value-forbidden } { \l_keys_path_tl } - { \toks_use:N \l_keys_value_toks } + \msg_kernel_error:nnxx { keys } { value-forbidden } + { \l_keys_path_tl } { \toks_use:N \l_keys_value_toks } } }{ \keys_execute: @@ -1181,7 +1197,7 @@ %\begin{macro}{\keys_show:nn} % Showing a key is just a question of using the correct name. % \begin{macrocode} -\cs_new_nopar:Nn \keys_show:nn { +\cs_new_nopar:Npn \keys_show:nn #1#2 { \cs_show:c { \c_keys_root_tl #1 / \tl_to_str:n {#2} .cmd:n } } % \end{macrocode} @@ -1198,7 +1214,7 @@ % If a value is given, return it as |#1|, otherwise send a default if % available. % \begin{macrocode} -\cs_new:Nn \keys_value_or_default:n { +\cs_new:Npn \keys_value_or_default:n #1 { \toks_set:Nn \l_keys_value_toks {#1} \bool_if:NT \l_keys_no_value_bool { \cs_if_exist:cT { \c_keys_root_tl \l_keys_path_tl .default_tl } { @@ -1215,7 +1231,7 @@ % Values can be required or forbidden by having the appropriate marker % set. % \begin{macrocode} -\cs_new_nopar:Nn \keys_value_requirement:n { +\cs_new_nopar:Npn \keys_value_requirement:n #1 { \tl_set_eq:cc { \c_keys_root_tl \l_keys_path_tl .req_tl } { c_keys_value_ #1 _tl } } @@ -1226,7 +1242,7 @@ % Setting a variable takes the type and scope separately so that % it is easy to make a new variable if needed. % \begin{macrocode} -\cs_new_nopar:Nn \keys_variable_set:NnNN { +\cs_new_nopar:Npn \keys_variable_set:NnNN #1#2#3#4 { \cs_if_exist:NF #1 { \use:c { #2 _new:N } #1 } @@ -1243,10 +1259,10 @@ %\begin{macro}{.bool_gset:N} % One function for this. % \begin{macrocode} -\keys_property_new:nn { .bool_set:N } { +\keys_property_new_arg:nn { .bool_set:N } { \keys_bool_set:NN #1 { } } -\keys_property_new:nn { .bool_gset:N } { +\keys_property_new_arg:nn { .bool_gset:N } { \keys_bool_set:NN #1 n } % \end{macrocode} @@ -1268,10 +1284,10 @@ % Storing the code for choices, using \cs{exp_not:n} to avoid needing % two internal functions. % \begin{macrocode} -\keys_property_new:nn { .choice_code:n } { +\keys_property_new_arg:nn { .choice_code:n } { \keys_choice_code_store:x { \exp_not:n {#1} } } -\keys_property_new:nn { .choice_code:x } { +\keys_property_new_arg:nn { .choice_code:x } { \keys_choice_code_store:x {#1} } % \end{macrocode} @@ -1283,10 +1299,10 @@ % Creating code is simply a case of passing through to the underlying % \texttt{set} function. % \begin{macrocode} -\keys_property_new:nn { .code:n } { +\keys_property_new_arg:nn { .code:n } { \keys_cmd_set:nn { \l_keys_path_tl } {#1} } -\keys_property_new:nn { .code:x } { +\keys_property_new_arg:nn { .code:x } { \keys_cmd_set:nx { \l_keys_path_tl } {#1} } % \end{macrocode} @@ -1297,10 +1313,10 @@ %\begin{macro}{.default:V} % Expansion is left to the internal functions. % \begin{macrocode} -\keys_property_new:nn { .default:n } { +\keys_property_new_arg:nn { .default:n } { \keys_default_set:n {#1} } -\keys_property_new:nn { .default:V } { +\keys_property_new_arg:nn { .default:V } { \keys_default_set:V #1 } % \end{macrocode} @@ -1311,10 +1327,10 @@ %\begin{macro}{.dim_gset:N} % Setting a variable is very easy: just pass the data along. % \begin{macrocode} -\keys_property_new:nn { .dim_set:N } { +\keys_property_new_arg:nn { .dim_set:N } { \keys_variable_set:NnNN #1 { dim } { } n } -\keys_property_new:nn { .dim_gset:N } { +\keys_property_new_arg:nn { .dim_gset:N } { \keys_variable_set:NnNN #1 { dim } g n } % \end{macrocode} @@ -1324,7 +1340,7 @@ %\begin{macro}{.generate_choices:n} % Making choices is easy. % \begin{macrocode} -\keys_property_new:nn { .generate_choices:n } { +\keys_property_new_arg:nn { .generate_choices:n } { \keys_choices_generate:n {#1} } % \end{macrocode} @@ -1334,10 +1350,10 @@ %\begin{macro}{.int_gset:N} % Setting a variable is very easy: just pass the data along. % \begin{macrocode} -\keys_property_new:nn { .int_set:N } { +\keys_property_new_arg:nn { .int_set:N } { \keys_variable_set:NnNN #1 { int } { } n } -\keys_property_new:nn { .int_gset:N } { +\keys_property_new_arg:nn { .int_gset:N } { \keys_variable_set:NnNN #1 { int } g n } % \end{macrocode} @@ -1348,10 +1364,10 @@ %\begin{macro}{.meta:x} % Making a meta is handled internally. % \begin{macrocode} -\keys_property_new:nn { .meta:n } { +\keys_property_new_arg:nn { .meta:n } { \keys_meta_make:n {#1} } -\keys_property_new:nn { .meta:x } { +\keys_property_new_arg:nn { .meta:x } { \keys_meta_make:x {#1} } % \end{macrocode} @@ -1362,10 +1378,10 @@ %\begin{macro}{.skip_gset:N} % Setting a variable is very easy: just pass the data along. % \begin{macrocode} -\keys_property_new:nn { .skip_set:N } { +\keys_property_new_arg:nn { .skip_set:N } { \keys_variable_set:NnNN #1 { skip } { } n } -\keys_property_new:nn { .skip_gset:N } { +\keys_property_new_arg:nn { .skip_gset:N } { \keys_variable_set:NnNN #1 { skip } g n } % \end{macrocode} @@ -1378,16 +1394,16 @@ %\begin{macro}{.tl_gset_x:N} % Setting a variable is very easy: just pass the data along. % \begin{macrocode} -\keys_property_new:nn { .tl_set:N } { +\keys_property_new_arg:nn { .tl_set:N } { \keys_variable_set:NnNN #1 { tl } { } n } -\keys_property_new:nn { .tl_set_x:N } { +\keys_property_new_arg:nn { .tl_set_x:N } { \keys_variable_set:NnNN #1 { tl } { } x } -\keys_property_new:nn { .tl_gset:N } { +\keys_property_new_arg:nn { .tl_gset:N } { \keys_variable_set:NnNN #1 { tl } g n } -\keys_property_new:nn { .tl_gset_x:N } { +\keys_property_new_arg:nn { .tl_gset_x:N } { \keys_variable_set:NnNN #1 { tl } g x } % \end{macrocode} @@ -1414,49 +1430,73 @@ % % For when there is a need to complain. % \begin{macrocode} -\msg_kernel_new:nn { key-choice-unknown } {% - Choice `#2' unknown for key `#1':\\% - the key is being ignored.% -} -\msg_kernel_new:nn { key-initial-without-code } {% - An initial value cannot be set for key `#1': - the key has not yet been created.% -} -\msg_kernel_new:nn { key-unknown } {% - The key `#1' is unknown and is being ignored.% -} -\msg_kernel_new:nn { key-value-forbidden }{% - The key `#1' cannot taken a value:\\% - the given input `#2' is being ignored.% -} -\msg_kernel_new:nn { key-value-required } {% - The key `#1' requires a value\\% - and is being ignored.% -} -\msg_kernel_new:nn { key-no-property } {% - No property given in definition of key `#1'.% -} -\msg_kernel_new:nnn { key-no-set-function } {% - There is no function #1\\% - for setting variable \exp_not:N #2.% -}{% - LaTeX can only `set' variables which have a function\\% - \exp_not:N \<var>_(g)set:Nn, or in some cases - \exp_not:N \<var>_(g)set:Nx.\\% - You have asked to `set' some other kind of variable.% - -} -\msg_kernel_new:nn { key-property-unknown } {% - The key property `#1' is unknown.% -} -\msg_kernel_new:nn { key-property-value-required } {% - The property `#1' requires a value\\% - and is being ignored.% -} +\msg_kernel_new:nnnn { keys } { choice-unknown } + {% + Choice `#2' unknown for key `#1':\\% + the key is being ignored.% + } + {% + The key `#1' takes a limited number of values.\\% + The input you gave, `#2', was not on the list accepted.\\% + Perhaps this is a typing error?% + } +\msg_kernel_new:nnnn { keys } { generate-choices-before-code } + {% + Cannot create choices for key `#1':\\% + no code has been defined.% + } + {% + Code for use by .generate_choices:n should first be defined\\% + using .choice_code:n or .choice_code:x.% + } +\msg_kernel_new:nnnn { keys } { key-no-property } + {No property given in definition of key `#1'.} + {% + Inside \token_to_str:N \keys_define:nn \msg_space: each key name + needs a property:\\% + \msg_two_spaces: #1 .<property>:\\% + I did not find a ``.'' to indicate the start of a property.% + } +\msg_kernel_new:nnnn { keys } { key-unknown } + {The key `#1' is unknown and is being ignored.} + {% + The module `#2' does not seem to implement a key called `#1'.\\% + I also checked for code to handle a unknown key, and did not + find any.% + Check that you have spelled the key name correctly.% + } +\msg_kernel_new:nnnn { keys } { property-unknown } + {The key property `#1' is unknown.} + {% + You have asked for key `#2' to have the property `#1'.\\% + However, I don't know the property `#1': this line will be ignored.% + } +\msg_kernel_new:nnnn { keys } { property-requires-value } + {The property `#1' requires a value.} + {% + You have tried to set the property `#2' for key `#1'.\\% + However, you did not give a value for this property, and one is + needed.\\% + The entire line will be ignored.% + } +\msg_kernel_new:nnnn { keys } { value-forbidden } + {The key `#1' does not taken a value.} + {% + The key `#1' should be given without a value.\\% + You gave `#1 = #2'; I will ignore `#2' and carry out whatever\\% + key `#1' is supposed to do.% + } +\msg_kernel_new:nnnn { keys } { value-required } + {The key `#1' requires a value.} + {% + The key `#1' should be given with a value.\\% + You gave `#1', but should have given `#1 = <value>'.\\% + I will ignore the key entirely.\\% + } % \end{macrocode} % % \begin{macrocode} %</initex|package> % \end{macrocode} % -%\end{implementation}
\ No newline at end of file +%\end{implementation} diff --git a/Master/texmf-dist/source/latex/expl3/l3msg.dtx b/Master/texmf-dist/source/latex/expl3/l3msg.dtx index a06612865a2..d3b33f44c55 100644 --- a/Master/texmf-dist/source/latex/expl3/l3msg.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3msg.dtx @@ -37,7 +37,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3msg.dtx 1502 2009-09-01 16:23:32Z joseph $ +\GetIdInfo$Id: l3msg.dtx 1722 2009-11-06 13:22:12Z joseph $ {L3 Experimental LaTeX Messages module} %\iffalse %<*driver> @@ -93,21 +93,19 @@ % output system. % %\begin{function}{ -% \msg_new:nnnnn| % \msg_new:nnnn| % \msg_new:nnn| -% \msg_set:nnnnn| % \msg_set:nnnn| % \msg_set:nnn %} % \begin{syntax} -% "\msg_new:nnnn" <module> <name> <text> <more text> <code> +% "\msg_new:nnnn" \marg{module} \marg{name} \marg{text} \marg{more text} % \end{syntax} -% Creates new message <name> for <module> to produce <text> initially, -% <more text> if requested by the user and to insert <code> after the -% message when used as an error. <text> and <more text> can use up to -% two macro parameters (|#1| and |#2|), which are supplied by the -% message system. Inside <text> and <more text> spaces are not ignored. +% Creates new message <name> for <module> to produce <text> initially +% and <more text> if requested by the user. <text> and <more text> can +% use up to four macro parameters (|#1| to |#4|), which are supplied by +% the message system. Inside <text> and <more text> spaces are not +% ignored. %\end{function} % % \section{Message classes} @@ -119,7 +117,7 @@ % \msg_class_set:nn %} % \begin{syntax} -% "\msg_class_new:nn" <class> <code> +% "\msg_class_new:nn" \marg{class} \marg{code} % \end{syntax} % Creates new <class> to output a message, using <code> to process % the message text. @@ -130,104 +128,126 @@ % the class or message is active. % %\begin{function}{ +% \msg_fatal:nnxxxx| +% \msg_fatal:nnxxx| % \msg_fatal:nnxx| % \msg_fatal:nnx| % \msg_fatal:nn %} % \begin{syntax} -% "\msg_fatal:nnxx" <module> <name> <arg one> <arg two> +% "\msg_fatal:nnxxxx" \marg{module} \marg{name} \marg{arg one} +% ~~~~\marg{arg two} \marg{arg three} \marg{arg four} % \end{syntax} -% Issues <module> error message <name>, passing <arg one> and -% <arg two> to the text-creating functions. The \TeX\ run then halts. +% Issues <module> error message <name>, passing <arg one> to +% <arg four> to the text-creating functions. The \TeX\ run then halts. %\end{function} % %\begin{function}{ +% \msg_error:nnxxxx| +% \msg_error:nnxxx| % \msg_error:nnxx| % \msg_error:nnx| % \msg_error:nn %} % \begin{syntax} -% "\msg_error:nnxx" <module> <name> <arg one> <arg two> +% "\msg_error:nnxxxx" \marg{module} \marg{name} \marg{arg one} +% ~~~~\marg{arg two} \marg{arg three} \marg{arg four} % \end{syntax} -% Issues <module> error message <name>, passing <arg one> and -% <arg two> to the text-creating functions. +% Issues <module> error message <name>, passing <arg one> to +% <arg four> to the text-creating functions. % \begin{texnote} % The standard output here is similar to \cs{PackageError}. % \end{texnote} %\end{function} % %\begin{function}{ +% \msg_warning:nnxxxx| +% \msg_warning:nnxxx| % \msg_warning:nnxx| % \msg_warning:nnx| % \msg_warning:nn %} % \begin{syntax} -% "\msg_warning:nnxx" <module> <name> <arg one> <arg two> +% "\msg_warning:nnxxxx" \marg{module} \marg{name} \marg{arg one} +% ~~~~\marg{arg two} \marg{arg three} \marg{arg four} % \end{syntax} -% Prints <module> message <name> to the terminal, passing <arg one> and -% <arg two> to the text-creating functions. +% Prints <module> message <name> to the terminal, passing <arg one> to +% <arg four> to the text-creating functions. % \begin{texnote} % The standard output here is similar to \cs{PackageWarningNoLine}. % \end{texnote} %\end{function} % %\begin{function}{ +% \msg_info:nnxxxx| +% \msg_info:nnxxx| % \msg_info:nnxx| % \msg_info:nnx| % \msg_info:nn %} % \begin{syntax} -% "\msg_info:nnxx" <module> <name> <arg one> <arg two> +% "\msg_info:nnxxxx" \marg{module} \marg{name} \marg{arg one} +% ~~~~\marg{arg two} \marg{arg three} \marg{arg four} % \end{syntax} -% Prints <module> message <name> to the log, passing <arg one> and -% <arg two> to the text-creating functions. +% Prints <module> message <name> to the log, passing <arg one> to +% <arg four> to the text-creating functions. % \begin{texnote} % The standard output here is similar to \cs{PackageInfoNoLine}. % \end{texnote} %\end{function} % %\begin{function}{ +% \msg_log:nnxxxx| +% \msg_log:nnxxx| % \msg_log:nnxx| % \msg_log:nnx| % \msg_log:nn %} % \begin{syntax} -% "\msg_info:nnxx" <module> <name> <arg one> <arg two> +% "\msg_log:nnxxxx" \marg{module} \marg{name} \marg{arg one} +% ~~~~\marg{arg two} \marg{arg three} \marg{arg four} % \end{syntax} -% Prints <module> message <name> to the log, passing <arg one> and -% <arg two> to the text-creating functions. No continuation text is +% Prints <module> message <name> to the log, passing <arg one> to +% <arg four> to the text-creating functions. No continuation text is % added. %\end{function} % %\begin{function}{ +% \msg_trace:nnxxxx| +% \msg_trace:nnxxx| % \msg_trace:nnxx| % \msg_trace:nnx| % \msg_trace:nn %} % \begin{syntax} -% "\msg_info:nnxx" <module> <name> <arg one> <arg two> +% "\msg_trace:nnxxxx" \marg{module} \marg{name} \marg{arg one} +% ~~~~\marg{arg two} \marg{arg three} \marg{arg four} % \end{syntax} -% Prints <module> message <name> to the log, passing <arg one> and -% <arg two> to the text-creating functions. No continuation text is +% Prints <module> message <name> to the log, passing <arg one> to +% <arg four> to the text-creating functions. No continuation text is % added. %\end{function} % %\begin{function}{ +% \msg_none:nnxxxx| +% \msg_none:nnxxx| % \msg_none:nnxx| % \msg_none:nnx| % \msg_none:nn %} % \begin{syntax} -% "\msg_none:nnxx" <module> <name> <arg one> <arg two> +% "\msg_none:nnxxxx" \marg{module} \marg{name} \marg{arg one} +% ~~~~\marg{arg two} \marg{arg three} \marg{arg four} % \end{syntax} -% Does nothing: used for redirecting other message classes. +% Does nothing: used for redirecting other message classes. Gobbles +% arguments given. %\end{function} % % \section{Redirecting messages} % %\begin{function}{\msg_redirect_class:nn} % \begin{syntax} -% "\msg_redirect_class:nn" <class one> <class two> +% "\msg_redirect_class:nn" \marg{class one} \marg{class two} % \end{syntax} % Redirect all messages of <class one> to appear as those of % <class two>. @@ -235,7 +255,8 @@ % %\begin{function}{\msg_redirect_module:nnn} % \begin{syntax} -% "\msg_redirect_module:nnn" <class one> <module> <class two> +% "\msg_redirect_module:nnn" \marg{module} \marg{class one} +% \marg{class two} % \end{syntax} % Redirect <module> messages of <class one> to appear in <class two>. % \begin{texnote} @@ -243,14 +264,14 @@ % default. For example, all of the \texttt{trace} messages of % <module> could be turned off with: % \begin{verbatim} -% \msg_redirect_module:nnn { trace } { module } { none } +% \msg_redirect_module:nnn { module } { trace } { none } % \end{verbatim} % \end{texnote} %\end{function} % %\begin{function}{\msg_redirect_name:nnn} % \begin{syntax} -% "\msg_redirect_name:nnn" <module> <message> <class> +% "\msg_redirect_name:nnn" \marg{module} \marg{message} \marg{class} % \end{syntax} % Redirect <module> <message> to appear using <class>. %\end{function} @@ -300,33 +321,30 @@ % respond to redirection. % %\begin{function}{ -% \msg_generic_new:nnnn| % \msg_generic_new:nnn| % \msg_generic_new:nn| -% \msg_generic_set:nnnn| % \msg_generic_set:nnn| % \msg_generic_set:nn %} % \begin{syntax} -% "\msg_generic_new:nnnn" <name> <text> <more text> <code> +% "\msg_generic_new:nnn" \marg{name} \marg{text} \marg{more text} % \end{syntax} -% Creates new message <name> to produce <text> initially, <more text> -% if requested by the user and to insert <code> after the message when -% used as an error. <text> and <more text> can use up to two macro -% parameters (|#1| and |#2|), which are supplied by the message system. -% Inside <text> and <more text> spaces are not ignored. +% Creates new message <name> to produce <text> initially and +% <more text> if requested by the user. <text> and <more text> can use +% up to four macro parameters (|#1| to |#4|), which are supplied by the +% message system. Inside <text> and <more text> spaces are not ignored. %\end{function} % -%\begin{function}{\msg_direct_interrupt:xxxxn} +%\begin{function}{\msg_direct_interrupt:xxxx} % \begin{syntax} -% "\msg_direct_interrupt:xxxxn" <first line> <text> -% ~~~~<continuation> <more text> <code> +% "\msg_direct_interrupt:xxxxn" \marg{first line} \marg{text} +% ~~~~\marg{continuation} \marg{more text} % \end{syntax} % Executes a \TeX\ error, interrupting compilation. The <first line> % is displayed followed by <text> and the input prompt. <more text> is -% displays if requested by the user, and <code> is inserted after the -% message. If <more text> is blank a default is supplied. Each line of -% <text> (broken with |\\|) begins with <continuation>. +% displays if requested by the user. If <more text> is blank a default +% is supplied. Each line of <text> (broken with |\\|) begins with +% <continuation>. %\end{function} % %\begin{function}{ @@ -334,7 +352,7 @@ % \msg_direct_term:xx %} % \begin{syntax} -% "\msg_direct_log:xx" <text> <continuation> +% "\msg_direct_log:xx" \marg{text} \marg{continuation} % \end{syntax} % Prints <text> to either the log or terminal. New lines (broken % with |\\|) start with <continuation>. @@ -345,73 +363,84 @@ %\begin{function}{ % \msg_kernel_new:nnnn| % \msg_kernel_new:nnn| -% \msg_kernel_new:nn| % \msg_kernel_set:nnnn| -% \msg_kernel_set:nnn| -% \msg_kernel_set:nn +% \msg_kernel_set:nnn %} % \begin{syntax} -% "\msg_kernel_new:nnn" <name> <text> <more text> <code> +% "\msg_kernel_new:nnnn" \marg{divsion} \marg{name} \marg{text} +% ~~~~\marg{more text} % \end{syntax} -% Creates new kernel message <name> to produce <text> initially, -% <more text> if requested by the user and to insert <code> after the -% message when used as an error. <text> and <more text> can use up to -% two macro parameters (|#1| and |#2|), which are supplied by the -% message system. +% Creates new kernel message <name> to produce <text> initially and +% <more text> if requested by the user. <text> and <more text> can use +% up to four macro parameters (|#1| to |#4|), which are supplied by the +% message system. Kernel messages are divided into <divisions>, roughly +% equivalent to the \LaTeXe\ package names used. %\end{function} % %\begin{function}{ -% \msg_kernel_fatal:nxx| -% \msg_kernel_fatal:nx| -% \msg_kernel_fatal:n +% \msg_kernel_fatal:nnxxxx| +% \msg_kernel_fatal:nnxxx| +% \msg_kernel_fatal:nnxx| +% \msg_kernel_fatal:nnx| +% \msg_kernel_fatal:nn %} % \begin{syntax} -% "\msg_kernel_fatal:nxx" <name> <arg one> <arg two> +% "\msg_kernel_fatal:nnxx" \marg{division} \marg{name} \marg{arg one} +% ~~~~\marg{arg two} \marg{arg three} \marg{arg four} % \end{syntax} -% Issues kernel error message <name>, passing <arg one> and -% <arg two> to the text-creating functions. The \TeX\ run then halts. -% Cannot be redirected. +% Issues kernel error message <name> for <division>, passing <arg one> +% to <arg four> to the text-creating functions. The \TeX\ run then +% halts. Cannot be redirected. %\end{function} % %\begin{function}{ -% \msg_kernel_error:nxx| -% \msg_kernel_error:nx| -% \msg_kernel_error:n +% \msg_kernel_error:nnxxxx| +% \msg_kernel_error:nnxxx| +% \msg_kernel_error:nnxx| +% \msg_kernel_error:nnx| +% \msg_kernel_error:nn %} % \begin{syntax} -% "\msg_kernel_error:nxx" <name> <arg one> <arg two> +% "\msg_kernel_error:nnxx" \marg{division} \marg{name} \marg{arg one} +% ~~~~\marg{arg two} \marg{arg three} \marg{arg four} % \end{syntax} -% Issues kernel error message <name>, passing <arg one> and -% <arg two> to the text-creating functions. Cannot be redirected. +% Issues kernel error message <name> for <division>, passing <arg one> +% to <arg four> to the text-creating functions. Cannot be redirected. %\end{function} % %\begin{function}{ -% \msg_kernel_warning:nxx| -% \msg_kernel_warning:nx| -% \msg_kernel_warning:n +% \msg_kernel_warning:nnxxxx| +% \msg_kernel_warning:nnxxx| +% \msg_kernel_warning:nnxx| +% \msg_kernel_warning:nnx| +% \msg_kernel_warning:nn %} % \begin{syntax} -% "\msg_kernel_warning:nxx" <name> <arg one> <arg two> +% "\msg_kernel_warning:nnxx" \marg{division} \marg{name} \marg{arg one} +% ~~~~\marg{arg two} \marg{arg three} \marg{arg four} % \end{syntax} -% Prints kernel message <name> to the terminal, passing <arg one> and -% <arg two> to the text-creating functions. +% Prints kernel message <name> for <division> to the terminal, passing +% <arg one> to <arg four> to the text-creating functions. %\end{function} % %\begin{function}{ -% \msg_kernel_info:nxx| -% \msg_kernel_info:nx| -% \msg_kernel_info:n +% \msg_kernel_info:nnxxxx| +% \msg_kernel_info:nnxxx| +% \msg_kernel_info:nnxx| +% \msg_kernel_info:nnx| +% \msg_kernel_info:nn %} % \begin{syntax} -% "\msg_kernel_info:nxx" <name> <arg one> <arg two> +% "\msg_kernel_info:nxx" \marg{division} \marg{name} \marg{arg one} +% ~~~~\marg{arg two} \marg{arg three} \marg{arg four} % \end{syntax} -% Prints kernel message <name> to the log, passing <arg one> and -% <arg two> to the text-creating functions. +% Prints kernel message <name> for <division> to the log, passing +% <arg one> to <arg four> to the text-creating functions. %\end{function} % %\begin{function}{\msg_kernel_bug:x} % \begin{syntax} -% "\msg_kernel_bug:x" <text> +% "\msg_kernel_bug:x" \marg{text} % \end{syntax} % Short-cut for ``This is a LaTeX bug: check coding'' errors. %\end{function} @@ -446,7 +475,6 @@ %\begin{variable}{ % \c_msg_text_prefix_tl| % \c_msg_more_text_prefix_tl| -% \c_msg_code_prefix_tl %} % Header information for storing the ``paths'' to parts of a message. %\end{variable} @@ -573,7 +601,7 @@ %\end{macro} % %\begin{macro}{\c_msg_on_line_tl} -% ``On line''. +% Text for ``on line''. % \begin{macrocode} \tl_new:Nn \c_msg_on_line_tl { on~line } % \end{macrocode} @@ -581,16 +609,13 @@ % %\begin{macro}{\c_msg_text_prefix_tl} %\begin{macro}{\c_msg_more_text_prefix_tl} -%\begin{macro}{\c_msg_code_prefix_tl} % Prefixes for storage areas. % \begin{macrocode} \tl_new:Nn \c_msg_text_prefix_tl { msg_text ~>~ } \tl_new:Nn \c_msg_more_text_prefix_tl { msg_text_more ~>~ } -\tl_new:Nn \c_msg_code_prefix_tl { msg_code ~>~ } % \end{macrocode} %\end{macro} %\end{macro} -%\end{macro} % %\begin{macro}{\l_msg_class_tl} %\begin{macro}{\l_msg_current_class_tl} @@ -632,11 +657,10 @@ %\begin{macro}{\msg_line_context:} % For writing the line number nicely. % \begin{macrocode} -\cs_new_nopar:Nn { \msg_line_number: } { +\cs_new_nopar:Npn \msg_line_number: { \toks_use:N \tex_inputlineno:D } -\cs_new_nopar:Nn { \msg_line_context: } { - \msg_space: +\cs_new_nopar:Npn \msg_line_context: { \c_msg_on_line_tl \msg_space: \msg_line_number: @@ -649,8 +673,8 @@ %\begin{macro}{\msg_two_newlines:} % Always forces a new line. % \begin{macrocode} -\cs_new_nopar:Nn \msg_newline: { ^^J } -\cs_new_nopar:Nn \msg_two_newlines: { ^^J ^^J } +\cs_new_nopar:Npn \msg_newline: { ^^J } +\cs_new_nopar:Npn \msg_two_newlines: { ^^J ^^J } % \end{macrocode} %\end{macro} %\end{macro} @@ -660,9 +684,11 @@ %\begin{macro}{\msg_four_spaces:} % For printing spaces, some very simple functions. % \begin{macrocode} -\cs_new_nopar:Nn \msg_space: { ~ } -\cs_new_nopar:Nn \msg_two_spaces: { \msg_space: \msg_space: } -\cs_new_nopar:Nn \msg_four_spaces: { \msg_two_spaces: \msg_two_spaces: } +\cs_new_nopar:Npn \msg_space: { ~ } +\cs_new_nopar:Npn \msg_two_spaces: { \msg_space: \msg_space: } +\cs_new_nopar:Npn \msg_four_spaces: { + \msg_two_spaces: \msg_two_spaces: +} % \end{macrocode} %\end{macro} %\end{macro} @@ -673,91 +699,55 @@ % The lowest level functions make no assumptions about modules, % \emph{etc.} % -%\begin{macro}{\msg_generic_new:nnnn} %\begin{macro}{\msg_generic_new:nnn} %\begin{macro}{\msg_generic_new:nn} % Creating a new message is basically the same as the non-checking % version, and so after a check everything hands over. % \begin{macrocode} -\cs_new_nopar:Npn \msg_generic_new:nnnn #1 { - \exp_args:Nc \chk_if_free_cs:N { \c_msg_text_prefix_tl #1 :nn } - \msg_generic_set:nnnn {#1} -} \cs_new_nopar:Npn \msg_generic_new:nnn #1 { - \exp_args:Nc \chk_if_free_cs:N { \c_msg_text_prefix_tl #1 :nn } + \chk_if_free_cs:c { \c_msg_text_prefix_tl #1 :xxxx } \msg_generic_set:nnn {#1} } \cs_new_nopar:Npn \msg_generic_new:nn #1 { - \exp_args:Nc \chk_if_free_cs:N { \c_msg_text_prefix_tl #1 :nn } + \chk_if_free_cs:c { \c_msg_text_prefix_tl #1 :xxxx } \msg_generic_set:nn {#1} } % \end{macrocode} %\end{macro} %\end{macro} -%\end{macro} % -%\begin{macro}{\msg_generic_set:nnnn} %\begin{macro}{\msg_generic_set:nnn} %\begin{macro}{\msg_generic_set:nn} %\begin{macro}[aux]{\msg_generic_set_clist:n} %\begin{macro}[aux]{\msg_generic_set_text:n} %\begin{macro}[aux]{\msg_generic_set_more_text:n} -%\begin{macro}[aux]{\msg_generic_set_code:n} % Creating a message is quite simple. There must be a short text part, -% while the other parts may not exist. To avoid filling up the hash -% table with empty functions,only non-empty arguments are stored. -% The various auxiliary functions are used to allow spaces in the -% text arguments. +% while the longer text may or may not be available. % \begin{macrocode} -\cs_new_nopar:Npn \msg_generic_set:nnnn #1 { - \msg_generic_set_clist:n {#1} - \char_make_space:N \ % - \msg_generic_set_code:nnnn{#1}% -} \cs_new_nopar:Npn \msg_generic_set:nnn #1 { \msg_generic_set_clist:n {#1} - \char_make_space:N \ % - \msg_generic_set_more_text:nnn{#1}% + \char_make_space:N \ + \msg_generic_set_more_text:nnn {#1} } \cs_new_nopar:Npn \msg_generic_set:nn #1 { \msg_generic_set_clist:n {#1} - \char_make_space:N \ % - \msg_generic_set_text:nn{#1}% + \char_make_space:N \ + \msg_generic_set_text:nn {#1} } \cs_new_nopar:Npn \msg_generic_set_clist:n #1 { \clist_if_in:NnF \l_msg_names_clist { // #1 / } { \clist_put_right:Nn \l_msg_names_clist { // #1 / } } } -\cs_new:Nn \msg_generic_set_text:nn { - \cs_set:cn { \c_msg_text_prefix_tl #1 :nn } {#2} +\cs_new:Npn \msg_generic_set_text:nn #1#2 { + \cs_set:cpn { \c_msg_text_prefix_tl #1 :xxxx } ##1##2##3##4 {#2} + \cs_set_eq:cN { \c_msg_more_text_prefix_tl #1 :xxxx } \c_undefined \char_make_ignore:N \ } -\cs_new:Nn \msg_generic_set_more_text:nnn { - \cs_set:cn { \c_msg_text_prefix_tl #1 :nn } {#2} - \tl_if_empty:nTF {#3} { - \cs_set_eq:cN { \c_msg_more_text_prefix_tl #1 } \c_undefined - }{ - \cs_set:cn { \c_msg_more_text_prefix_tl #1 :nn } {#3} - } - \char_make_ignore:N \ -} -\cs_new:Npn \msg_generic_set_code:nnnn #1#2#3 { - \cs_set:cn { \c_msg_text_prefix_tl #1 :nn } {#2} - \tl_if_empty:nTF {#3} { - \cs_set_eq:cN { \c_msg_more_text_prefix_tl #1 } \c_undefined - }{ - \cs_set:cn { \c_msg_more_text_prefix_tl #1 :nn } {#3} - } +\cs_new:Npn \msg_generic_set_more_text:nnn #1#2#3 { + \cs_set:cpn { \c_msg_text_prefix_tl #1 :xxxx } ##1##2##3##4 {#2} + \cs_set:cpn { \c_msg_more_text_prefix_tl #1 :xxxx } ##1##2##3##4 {#3} \char_make_ignore:N \ - \msg_generic_set_code:nn {#1} -} -\cs_new:Nn \msg_generic_set_code:nn { - \tl_if_empty:nTF {#2} { - \cs_set_eq:cN { \c_msg_code_prefix_tl #1 : } \c_undefined - }{ - \cs_set:cn { \c_msg_code_prefix_tl #1 : } {#2} - } } % \end{macrocode} %\end{macro} @@ -765,19 +755,17 @@ %\end{macro} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} % -%\begin{macro}{\msg_direct_interrupt:xxxxn} +%\begin{macro}{\msg_direct_interrupt:xxxx} %\begin{macro}[aux]{\msg_direct_interrupt:n} % The low-level interruption macro is rather opaque, unfortunately. The % idea here is to create a a message which hides all of \TeX's own % information by filling the output up with spaces. To achieve this, % spaces have to be letters: hence no indentation. The odd -% \cs{c_msg_hide_tl} actually does the hiding: it is the large run of -% spaces in the name that is important here. The meaning of |\\| -% is altered so that the explanation text is a simple run whilst the -% initial error has line-continuation shown. +% \cs{c_msg_hide_tl<spaces>} actually does the hiding: it is the +% large run of spaces in the name that is important here. The meaning +% of |\\| is altered so that the explanation text is a simple run +% whilst the initial error has line-continuation shown. % \begin{macrocode} \group_begin: \char_set_lccode:nn {`\&} {`\ } % { @@ -786,7 +774,7 @@ \char_make_letter:N\ % \tl_to_lowercase:n{% \group_end:% -\cs_new_protected:Nn\msg_direct_interrupt:xxxxn{% +\cs_new_protected:Npn\msg_direct_interrupt:xxxx#1#2#3#4{% \group_begin:% \cs_set_eq:NN\\\msg_newline:% \cs_set_eq:NN\ \msg_space:% @@ -803,14 +791,13 @@ }% &% \group_end:% -#5% }% }% -\cs_new:Nn \msg_direct_interrupt_aux:n { +\cs_new:Npn \msg_direct_interrupt_aux:n #1 { \tl_if_empty:nTF {#1} { \tl_set:Nx \l_msg_tmp_tl { { \c_msg_no_info_text_tl } } }{ - \tl_set:Nx \l_msg_tmp_tl { {#1 } } + \tl_set:Nx \l_msg_tmp_tl { {#1} } } } % \end{macrocode} @@ -821,14 +808,14 @@ %\begin{macro}{\msg_direct_term:xx} % Printing to the log or terminal without a stop is rather easier. % \begin{macrocode} -\cs_new_protected:Nn \msg_direct_log:xx { +\cs_new_protected:Npn \msg_direct_log:xx #1#2 { \group_begin: \cs_set:Npn \\ { \msg_newline: #2 } \cs_set_eq:NN \ \msg_space: \iow_log:x { #1 \msg_newline: } \group_end: } -\cs_new_protected:Nn \msg_direct_term:xx { +\cs_new_protected:Npn \msg_direct_term:xx #1#2 { \group_begin: \cs_set:Npn \\ { \msg_newline: #2 } \cs_set_eq:NN \ \msg_space: @@ -845,26 +832,18 @@ % module from the message name. These have short names as they will be % widely used. % -%\begin{macro}{\msg_new:nnnnn} %\begin{macro}{\msg_new:nnnn} %\begin{macro}{\msg_new:nnn} -%\begin{macro}{\msg_set:nnnnn} %\begin{macro}{\msg_set:nnnn} %\begin{macro}{\msg_set:nnn} -% For making messages. +% For making messages: all aliases. % \begin{macrocode} -\cs_new_nopar:Npn \msg_new:nnnnn #1#2 { - \msg_generic_new:nnnn { #1 / #2 } -} \cs_new_nopar:Npn \msg_new:nnnn #1#2 { \msg_generic_new:nnn { #1 / #2 } } \cs_new_nopar:Npn \msg_new:nnn #1#2 { \msg_generic_new:nn { #1 / #2 } } -\cs_new_nopar:Npn \msg_set:nnnnn #1#2 { - \msg_generic_set:nnnn { #1 / #2 } -} \cs_new_nopar:Npn \msg_set:nnnn #1#2 { \msg_generic_set:nnn { #1 / #2 } } @@ -873,8 +852,6 @@ } % \end{macrocode} %\end{macro} -%\end{macro} -%\end{macro} %\end{macro} %\end{macro} %\end{macro} @@ -886,63 +863,70 @@ % so that redirection will work as desired. % \begin{macrocode} \cs_new_nopar:Npn \msg_class_new:nn #1 { - \exp_args:Nc \chk_if_free_cs:N { msg_ #1 :nnxx } + \chk_if_free_cs:c { msg_ #1 :nnxxxx } \prop_new:c { l_msg_redirect_ #1 _prop } \msg_class_set:nn {#1} } -\cs_new_nopar:Nn \msg_class_set:nn { +\cs_new_nopar:Npn \msg_class_set:nn #1#2 { \prop_clear:c { l_msg_redirect_ #1 _prop } - \cs_set_protected:cn { msg_ #1 :nnxx } { - \msg_use:nnnnxx {#1} {#2} {##1} {##2} {##3} {##4} + \cs_set_protected:cpn { msg_ #1 :nnxxxx } ##1##2##3##4##5##6 { + \msg_use:nnnnxxxx {#1} {#2} {##1} {##2} {##3} {##4} {##5} {##6} + } + \cs_set_protected:cpx { msg_ #1 :nnxxx } ##1##2##3##4##5 { + \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} {##5} { } } - \cs_set_protected:cn { msg_ #1 :nnx } { - \use:c { msg_ #1 :nnxx } {##1} {##2} {##3} { } + \cs_set_protected:cpx { msg_ #1 :nnxx } ##1##2##3##4 { + \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} { } { } } - \cs_set_protected:cn { msg_ #1 :nn } { - \use:c { msg_ #1 :nnxx } {##1} {##2} { } { } + \cs_set_protected:cpx { msg_ #1 :nnx } ##1##2##3 { + \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { } + } + \cs_set_protected:cpx { msg_ #1 :nn } ##1##2 { + \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} { } { } { } { } } } % \end{macrocode} %\end{macro} %\end{macro} % -%\begin{macro}[aux]{\msg_use:nnnnxx} +%\begin{macro}[aux]{\msg_use:nnnnxxxx} % The main message-using macro creates two auxiliary functions: one % containing the code for the message, and the second a loop function. % There is then a hand-off to the system for checking if redirection is % needed. % \begin{macrocode} -\cs_new:Nn \msg_use:nnnnxx { - \cs_set:Nn \msg_use_code: { +\cs_new:Npn \msg_use:nnnnxxxx #1#2#3#4#5#6#7#8 { + \cs_set_nopar:Npn \msg_use_code: { \clist_clear:N \l_msg_redirect_classes_clist #2 } - \cs_set:Nn \msg_use_loop:n { + \cs_set:Npn \msg_use_loop:n ##1 { \clist_if_in:NnTF \l_msg_redirect_classes_clist {#1} { - \msg_kernel_error:n { message-loop } + \msg_kernel_error:nn { msg } { redirect-loop } {#1} }{ \clist_put_right:Nn \l_msg_redirect_classes_clist {#1} - \cs_if_exist:cTF { msg_ ##1 :nnxx } { - \use:c { msg_ ##1 :nnxx } {#3} {#4} {#5} {#6} + \cs_if_exist:cTF { msg_ ##1 :nnxxxx } { + \use:c { msg_ ##1 :nnxxxx } {#3} {#4} {#5} {#6} {#7} {#8} }{ - \msg_kernel_error:nx { message-class-unknown } { ##1 } + \msg_kernel_error:nnx { msg } { message-class-unknown } {##1} } } } - \cs_if_exist:cTF { \c_msg_text_prefix_tl #3 / #4 :nn } { + \cs_if_exist:cTF { \c_msg_text_prefix_tl #3 / #4 :xxxx } { \msg_use_aux:nnn {#1} {#3} {#4} }{ - \msg_kernel_error:nxx { message-unknown } { #3 } { #4 } + \msg_kernel_error:nnxx { msg } { message-unknown } {#3} {#4} } } % \end{macrocode} %\end{macro} +% %\begin{macro}[aux]{\msg_use_code:} %\begin{macro}[aux]{\msg_use_loop:} % Blank definitions are initially created for these functions. % \begin{macrocode} -\cs_new_nopar:Nn \msg_use_code: { } -\cs_new_nopar:Nn \msg_use_loop:n { } +\cs_new_nopar:Npn \msg_use_code: { } +\cs_new:Npn \msg_use_loop:n #1 { } % \end{macrocode} %\end{macro} %\end{macro} @@ -951,7 +935,7 @@ % The first auxiliary macro looks for a match by name: the most % restrictive check. % \begin{macrocode} -\cs_new_nopar:Nn \msg_use_aux:nnn { +\cs_new_nopar:Npn \msg_use_aux:nnn #1#2#3 { \tl_set:Nn \l_msg_current_class_tl {#1} \tl_set:Nn \l_msg_current_module_tl {#2} \prop_if_in:NnTF \l_msg_redirect_names_prop { // #2 / #3 / } { @@ -966,12 +950,12 @@ % The second function checks for general matches by module or for % all modules. % \begin{macrocode} -\cs_new_nopar:Nn \msg_use_aux:nn { +\cs_new_nopar:Npn \msg_use_aux:nn #1#2 { \prop_if_in:cnTF { l_msg_redirect_ #1 _prop } {#2} { \msg_use_loop_check:nn {#1} {#2} }{ - \prop_if_in:cnTF { l_msg_redirect_ #1 _prop } {*} { - \msg_use_loop_check:nn {#1} {*} + \prop_if_in:cnTF { l_msg_redirect_ #1 _prop } { * } { + \msg_use_loop_check:nn {#1} { * } }{ \msg_use_code: } @@ -983,7 +967,7 @@ % When checking whether to loop, the same code is needed in a few % places. % \begin{macrocode} -\cs_new:Nn \msg_use_loop_check:nn { +\cs_new:Npn \msg_use_loop_check:nn #1#2 { \prop_get:cnN { l_msg_redirect_ #1 _prop } {#2} \l_msg_class_tl \tl_if_eq:NNTF \l_msg_current_class_tl \l_msg_class_tl { \msg_use_code: @@ -994,27 +978,33 @@ % \end{macrocode} %\end{macro} % +%\begin{macro}{\msg_fatal:nnxxxx} +%\begin{macro}{\msg_fatal:nnxxx} %\begin{macro}{\msg_fatal:nnxx} %\begin{macro}{\msg_fatal:nnx} %\begin{macro}{\msg_fatal:nn} % For fatal errors, after the error message \TeX\ bails out. % \begin{macrocode} \msg_class_new:nn { fatal } { - \msg_direct_interrupt:xxxxn + \msg_direct_interrupt:xxxx { \c_msg_fatal_tl \msg_two_newlines: } { ( \c_msg_fatal_tl ) \msg_space: - \use:c { \c_msg_text_prefix_tl #1 / #2 :nn } {#3} {#4} + \use:c { \c_msg_text_prefix_tl #1 / #2 :xxxx } {#3} {#4} {#5} {#6} } { ( \c_msg_fatal_tl ) \msg_space: } { \c_msg_fatal_text_tl } - { \tex_end:D } + \tex_end:D } % \end{macrocode} %\end{macro} %\end{macro} %\end{macro} +%\end{macro} +%\end{macro} % +%\begin{macro}{\msg_error:nnxxxx} +%\begin{macro}{\msg_error:nnxxx} %\begin{macro}{\msg_error:nnxx} %\begin{macro}{\msg_error:nnx} %\begin{macro}{\msg_error:nn} @@ -1022,31 +1012,31 @@ % is tried. % \begin{macrocode} \msg_class_new:nn { error } { - \msg_direct_interrupt:xxxxn + \msg_direct_interrupt:xxxx { #1~\c_msg_error_tl \msg_newline: } { ( #1 ) \msg_space: - \use:c { \c_msg_text_prefix_tl #1 / #2 :nn } {#3} {#4} + \use:c { \c_msg_text_prefix_tl #1 / #2 :xxxx } {#3} {#4} {#5} {#6} } { ( #1 ) \msg_space: } { - \cs_if_exist:cTF { \c_msg_more_text_prefix_tl #1 / #2 :nn } { - \use:c { \c_msg_more_text_prefix_tl #1 / #2 :nn } {#3} {#4} - }{ - \c_msg_no_info_text_tl - } - } - { - \cs_if_exist:cT { \c_msg_code_prefix_tl #1 /#2 :nn } { - \use:c { \c_msg_code_prefix_tl #1 / #2 :nn} {#3} {#4} - } + \cs_if_exist:cTF { \c_msg_more_text_prefix_tl #1 / #2 :xxxx } + { + \use:c { \c_msg_more_text_prefix_tl #1 / #2 :xxxx } + {#3} {#4} {#5} {#6} + } + { \c_msg_no_info_text_tl } } } % \end{macrocode} %\end{macro} %\end{macro} %\end{macro} +%\end{macro} +%\end{macro} % +%\begin{macro}{\msg_warning:nnxxxx} +%\begin{macro}{\msg_warning:nnxxx} %\begin{macro}{\msg_warning:nnxx} %\begin{macro}{\msg_warning:nnx} %\begin{macro}{\msg_warning:nn} @@ -1054,8 +1044,8 @@ % \begin{macrocode} \msg_class_new:nn { warning } { \msg_direct_term:xx { - \msg_space: #1~\c_msg_warning_tl :~ - \use:c { \c_msg_text_prefix_tl #1 / #2 :nn } {#3} {#4} + \msg_space: #1 ~ \c_msg_warning_tl :~ + \use:c { \c_msg_text_prefix_tl #1 / #2 :xxxx } {#3} {#4} {#5} {#6} } { ( #1 ) \msg_two_spaces: } } @@ -1063,7 +1053,11 @@ %\end{macro} %\end{macro} %\end{macro} +%\end{macro} +%\end{macro} % +%\begin{macro}{\msg_info:nnxxxx} +%\begin{macro}{\msg_info:nnxxx} %\begin{macro}{\msg_info:nnxx} %\begin{macro}{\msg_info:nnx} %\begin{macro}{\msg_info:nn} @@ -1072,7 +1066,7 @@ \msg_class_new:nn { info } { \msg_direct_log:xx { \msg_space: #1~\c_msg_info_tl :~ - \use:c { \c_msg_text_prefix_tl #1 / #2 :nn } {#3} {#4} + \use:c { \c_msg_text_prefix_tl #1 / #2 :xxxx } {#3} {#4} {#5} {#6} } { ( #1 ) \msg_two_spaces: } } @@ -1080,7 +1074,11 @@ %\end{macro} %\end{macro} %\end{macro} +%\end{macro} +%\end{macro} % +%\begin{macro}{\msg_log:nnxxxx} +%\begin{macro}{\msg_log:nnxxx} %\begin{macro}{\msg_log:nnxx} %\begin{macro}{\msg_log:nnx} %\begin{macro}{\msg_log:nn} @@ -1089,7 +1087,7 @@ % \begin{macrocode} \msg_class_new:nn { log } { \msg_direct_log:xx { - \use:c { \c_msg_text_prefix_tl #1 / #2 :nn } {#3} {#4} + \use:c { \c_msg_text_prefix_tl #1 / #2 :xxxx } {#3} {#4} {#5} {#6} } { } } @@ -1097,7 +1095,11 @@ %\end{macro} %\end{macro} %\end{macro} +%\end{macro} +%\end{macro} % +%\begin{macro}{\msg_trace:nnxxxx} +%\begin{macro}{\msg_trace:nnxxx} %\begin{macro}{\msg_trace:nnxx} %\begin{macro}{\msg_trace:nnx} %\begin{macro}{\msg_trace:nn} @@ -1105,7 +1107,7 @@ % \begin{macrocode} \msg_class_new:nn { trace } { \msg_direct_log:xx { - \use:c { \c_msg_text_prefix_tl #1 / #2 :nn } {#3} {#4} + \use:c { \c_msg_text_prefix_tl #1 / #2 :xxxx } {#3} {#4} {#5} {#6} } { } } @@ -1113,7 +1115,11 @@ %\end{macro} %\end{macro} %\end{macro} +%\end{macro} +%\end{macro} % +%\begin{macro}{\msg_none:nnxxxx} +%\begin{macro}{\msg_none:nnxxx} %\begin{macro}{\msg_none:nnxx} %\begin{macro}{\msg_none:nnx} %\begin{macro}{\msg_none:nn} @@ -1124,14 +1130,16 @@ %\end{macro} %\end{macro} %\end{macro} +%\end{macro} +%\end{macro} % %\subsection{Redirection functions} % %\begin{macro}{\msg_redirect_class:nn} % Converts class one into class two. % \begin{macrocode} -\cs_new_nopar:Nn \msg_redirect_class:nn { - \prop_put:cnn { l_msg_redirect_ #1 _prop } {*} {#2} +\cs_new_nopar:Npn \msg_redirect_class:nn #1#2 { + \prop_put:cnn { l_msg_redirect_ #1 _prop } { * } {#2} } % \end{macrocode} %\end{macro} @@ -1139,7 +1147,7 @@ %\begin{macro}{\msg_redirect_module:nnn} % For when all messages of a class should be altered for a given module. % \begin{macrocode} -\cs_new_nopar:Nn \msg_redirect_module:nnn { +\cs_new_nopar:Npn \msg_redirect_module:nnn #1#2#3 { \prop_put:cnn { l_msg_redirect_ #2 _prop } {#1} {#3} } % \end{macrocode} @@ -1148,7 +1156,7 @@ %\begin{macro}{\msg_redirect_name:nnn} % Named message will always use the given class. % \begin{macrocode} -\cs_new_nopar:Nn \msg_redirect_name:nnn { +\cs_new_nopar:Npn \msg_redirect_name:nnn #1#2#3 { \prop_put:Nnn \l_msg_redirect_names_prop { // #1 / #2 / } {#3} } % \end{macrocode} @@ -1158,100 +1166,107 @@ % %\begin{macro}{\msg_kernel_new:nnnn} %\begin{macro}{\msg_kernel_new:nnn} -%\begin{macro}{\msg_kernel_new:nn} %\begin{macro}{\msg_kernel_set:nnnn} %\begin{macro}{\msg_kernel_set:nnn} -%\begin{macro}{\msg_kernel_set:nn} % The kernel needs some messages of its own. These are created using % pre-built functions. Two functions are provided: one more general % and one which only has the short text part. % \begin{macrocode} -\cs_new_nopar:Npn \msg_kernel_new:nnnn #1 { - \msg_new:nnnnn { LaTeX } {#1} -} -\cs_new_nopar:Npn \msg_kernel_new:nnn #1 { - \msg_new:nnnn { LaTeX } {#1} +\cs_new_nopar:Npn \msg_kernel_new:nnnn #1#2 { + \msg_new:nnnn { LaTeX } { #1 / #2 } } -\cs_new_nopar:Npn \msg_kernel_new:nn #1 { - \msg_new:nnn { LaTeX } {#1} +\cs_new_nopar:Npn \msg_kernel_new:nnn #1#2 { + \msg_new:nnn { LaTeX } { #1 / #2 } } -\cs_new_nopar:Npn \msg_kernel_set:nnnn #1 { - \msg_set:nnnnn { LaTeX } {#1} +\cs_new_nopar:Npn \msg_kernel_set:nnnn #1#2 { + \msg_set:nnnn { LaTeX } { #1 / #2 } } -\cs_new_nopar:Npn \msg_kernel_set:nnn #1 { - \msg_set:nnnn { LaTeX } {#1} -} -\cs_new_nopar:Npn \msg_kernel_set:nn #1 { - \msg_set:nnn { LaTeX } {#1} +\cs_new_nopar:Npn \msg_kernel_set:nnn #1#2 { + \msg_set:nnn { LaTeX } { #1 / #2 } } % \end{macrocode} %\end{macro} %\end{macro} %\end{macro} %\end{macro} -%\end{macro} -%\end{macro} % %\begin{macro}[aux]{\msg_kernel_classes_new:n} % Quickly make the fewer-arguments versions. % \begin{macrocode} -\cs_new_nopar:Nn \msg_kernel_classes_new:n { - \cs_new_protected:cn { msg_kernel_ #1 :nx } { - \use:c { msg_kernel_ #1 :nxx } {##1} {##2} { } +\cs_new_nopar:Npn \msg_kernel_classes_new:n #1 { + \cs_new_protected:cpx { msg_kernel_ #1 :nnxxx } ##1##2##3##4##5 + { + \exp_not:c { msg_kernel_ #1 :nnxxxx } + {##1} {##2} {##3} {##4} {##5} { } + } + \cs_new_protected:cpx { msg_kernel_ #1 :nnxx } ##1##2##3##4 + { + \exp_not:c { msg_kernel_ #1 :nnxxxx } + {##1} {##2} {##3} {##4} { } { } } - \cs_new_protected:cn { msg_kernel_ #1 :n } { - \use:c { msg_kernel_ #1 :nxx } {##1} { } { } + \cs_new_protected:cpx { msg_kernel_ #1 :nnx } ##1##2##3 + { + \exp_not:c { msg_kernel_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { } + } + \cs_new_protected:cpx { msg_kernel_ #1 :nn } ##1##2 + { + \exp_not:c { msg_kernel_ #1 :nnxxxx } {##1} {##2} { } { } { } { } } } % \end{macrocode} %\end{macro} % -%\begin{macro}{\msg_kernel_fatal:nxx} -%\begin{macro}{\msg_kernel_fatal:nx} -%\begin{macro}{\msg_kernel_fatal:n} +%\begin{macro}{\msg_kernel_fatal:nnxxxx} +%\begin{macro}{\msg_kernel_fatal:nnxxx} +%\begin{macro}{\msg_kernel_fatal:nnxx} +%\begin{macro}{\msg_kernel_fatal:nnx} +%\begin{macro}{\msg_kernel_fatal:nn} % Fatal kernel errors cannot be re-defined. % \begin{macrocode} -\cs_new_protected:Nn \msg_kernel_fatal:nxx { - \msg_direct_interrupt:xxxxn +\cs_new_protected:Npn \msg_kernel_fatal:nnxxxx #1#2#3#4#5#6 { + \msg_direct_interrupt:xxxx { \c_msg_fatal_tl \msg_two_newlines: } { ( LaTeX ) \msg_space: - \use:c { \c_msg_text_prefix_tl LaTeX / #1 :nn } {#2} {#3} + \use:c { \c_msg_text_prefix_tl LaTeX / #1 / #2 :xxxx } + {#3} {#4} {#5} {#6} } { ( LaTeX ) \msg_space: } { \c_msg_fatal_text_tl } - { \tex_end:D } + \tex_end:D } \msg_kernel_classes_new:n { fatal } % \end{macrocode} %\end{macro} %\end{macro} %\end{macro} +%\end{macro} +%\end{macro} % -%\begin{macro}{\msg_kernel_error:nxx} -%\begin{macro}{\msg_kernel_error:nx} -%\begin{macro}{\msg_kernel_error:n} +%\begin{macro}{\msg_kernel_error:nnxxxx} +%\begin{macro}{\msg_kernel_error:nnxxx} +%\begin{macro}{\msg_kernel_error:nnxx} +%\begin{macro}{\msg_kernel_error:nnx} +%\begin{macro}{\msg_kernel_error:nn} % Neither can kernel errors. % \begin{macrocode} -\cs_new_protected:Nn \msg_kernel_error:nxx { - \msg_direct_interrupt:xxxxn +\cs_new_protected:Npn \msg_kernel_error:nnxxxx #1#2#3#4#5#6 { + \msg_direct_interrupt:xxxx { LaTeX~\c_msg_error_tl \msg_newline: } { ( LaTeX ) \msg_space: - \use:c { \c_msg_text_prefix_tl LaTeX / #1 :nn } {#2} {#3} + \use:c { \c_msg_text_prefix_tl LaTeX / #1 / #2 :xxxx } + {#3} {#4} {#5} {#6} } { ( LaTeX ) \msg_space: } { - \cs_if_exist:cTF { \c_msg_more_text_prefix_tl LaTeX / #1 :nn } { - \use:c { \c_msg_more_text_prefix_tl LaTeX / #1 :nn } {#2} {#3} - }{ - \c_msg_no_info_text_tl - } - } - { - \cs_if_exist:cT { \c_msg_code_prefix_tl LaTeX /#1 :nn } { - \use:c { \c_msg_code_prefix_tl LaTeX / #1 :nn} {#2} {#3} - } + \cs_if_exist:cTF + { \c_msg_more_text_prefix_tl LaTeX / #1 / #2 :xxxx } + { + \use:c { \c_msg_more_text_prefix_tl LaTeX / #1 / #2 :xxxx } + {#3} {#4} {#5} {#6} + } + { \c_msg_no_info_text_tl } } } \msg_kernel_classes_new:n { error } @@ -1259,22 +1274,28 @@ %\end{macro} %\end{macro} %\end{macro} +%\end{macro} +%\end{macro} % -%\begin{macro}{\msg_kernel_warning:nxx} -%\begin{macro}{\msg_kernel_warning:nx} -%\begin{macro}{\msg_kernel_warning:n} -%\begin{macro}{\msg_kernel_info:nxx} -%\begin{macro}{\msg_kernel_info:nx} -%\begin{macro}{\msg_kernel_info:n} +%\begin{macro}{\msg_kernel_warning:nnxxxx} +%\begin{macro}{\msg_kernel_warning:nnxxx} +%\begin{macro}{\msg_kernel_warning:nnxx} +%\begin{macro}{\msg_kernel_warning:nnx} +%\begin{macro}{\msg_kernel_warning:nn} +%\begin{macro}{\msg_kernel_info:nnxxxx} +%\begin{macro}{\msg_kernel_info:nnxxx} +%\begin{macro}{\msg_kernel_info:nnxx} +%\begin{macro}{\msg_kernel_info:nnx} +%\begin{macro}{\msg_kernel_info:nn} % Life is much more simple for warnings and information messages, as % these are just short-cuts to the standard classes. % \begin{macrocode} -\cs_new_protected_nopar:Npn \msg_kernel_warning:nxx { - \msg_warning:nnxx { LaTeX } +\cs_new_protected_nopar:Npn \msg_kernel_warning:nnxxxx #1#2 { + \msg_warning:nnxxxx { LaTeX } { #1 / #2 } } \msg_kernel_classes_new:n { warning } -\cs_new_protected_nopar:Npn \msg_kernel_info:nxx { - \msg_info:nnxx { LaTeX } +\cs_new_protected_nopar:Npn \msg_kernel_info:nnxxxx #1#2 { + \msg_info:nnxxxx { LaTeX } { #1 / #2 } } \msg_kernel_classes_new:n { info } % \end{macrocode} @@ -1284,50 +1305,49 @@ %\end{macro} %\end{macro} %\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} % -% Some very basic error messages. +% Error messages needed to actually implement the message system +% itself. % \begin{macrocode} -\msg_kernel_new:nnn { coding-bug } {% - This is a LaTeX bug: check coding!\\% - #1% -}{% - #2% -} -\msg_kernel_new:nnn { message-unknown } {% - Unknown message `#2' for module `#1'.% -}{% - LaTeX was asked to display a message by the `#1' module.\\% - The message was supposed to be called `#2', but I can't\\% - find a message with that name. - \c_msg_return_text_tl -} -\msg_kernel_new:nnn { message-class-unknown } {% - Unknown message class `#1'.% -}{% - You have asked for a message to be redirected to class `#1'\\% - but this class is unknown. - \c_msg_return_text_tl -} -\msg_kernel_new:nnn { message-loop } {% - Message redirection loop.% -}{% - You have asked for a message to be redirected,\\% - but the redirection instructions form a loop:\\% - you've lost the message. - \c_msg_return_text_tl -} +\msg_kernel_new:nnnn { msg } { message-unknown } + {Unknown message `#2' for module `#1'.} + {% + LaTeX was asked to display a message by the `#1' module.\\% + The message was supposed to be called `#2', but I can't\\% + find a message with that name.% + \c_msg_return_text_tl + } +\msg_kernel_new:nnnn { msg } { message-class-unknown } + {Unknown message class `#1'.} + {% + You have asked for a message to be redirected to class `#1'.\\% + The message class `#1' has not been set up:\\% + perhaps this is a typing error.% + \c_msg_return_text_tl + } +\msg_kernel_new:nnnn { msg } { redirect-loop } + {Message redirection loop for message class `#1'.} + {% + You have asked for a message to be redirected,\\% + but the redirection instructions form a loop:\\% + you've lost the message.% + \c_msg_return_text_tl + } % \end{macrocode} % %\begin{macro}{\msg_kernel_bug:x} % The \LaTeX\ coding bug error gets re-visited here. % \begin{macrocode} -\cs_set_protected:Nn \msg_kernel_bug:x { - \msg_direct_interrupt:xxxxn +\cs_set_protected:Npn \msg_kernel_bug:x #1 { + \msg_direct_interrupt:xxxx { \c_msg_kernel_bug_text_tl } { !~#1 } { ! } { \c_msg_kernel_bug_more_text_tl } - { } } % \end{macrocode} %\end{macro} diff --git a/Master/texmf-dist/source/latex/expl3/l3names.dtx b/Master/texmf-dist/source/latex/expl3/l3names.dtx index 777ccace59d..1075405c0b2 100644 --- a/Master/texmf-dist/source/latex/expl3/l3names.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3names.dtx @@ -102,7 +102,7 @@ \RequirePackage{l3names} %</driver> %\fi -\GetIdInfo$Id: l3names.dtx 1452 2009-08-08 14:09:32Z joseph $ +\GetIdInfo$Id: l3names.dtx 1677 2009-11-02 08:24:04Z joseph $ {L3 Experimental Naming Scheme for TeX Primitives} % % @@ -1111,7 +1111,7 @@ % as the packages in this distribution do like this: % \begin{verbatim} % \RequirePackage{l3names} -% \GetIdInfo$Id: l3names.dtx 1452 2009-08-08 14:09:32Z joseph $ +% \GetIdInfo$Id: l3names.dtx 1677 2009-11-02 08:24:04Z joseph $ % {L3 Experimental Box module} % \ProvidesExplPackage % {\filename}{\filedate}{\fileversion}{\filedescription} @@ -1157,11 +1157,11 @@ % \begin{verbatim} % \RequirePackage{l3names} % \ProvidesExplPackage{foobar}{2009/05/07}{0.1}{Foobar package} -% \cs_new:Nn \foo_bar:nn {#1,#2} +% \cs_new:Npn \foo_bar:nn #1#2 {#1,#2} % ... % \RequirePackage{array} % ... -% \cs_new:Nn \foo_bar:nnn {#3,#2,#1} +% \cs_new:Npn \foo_bar:nnn #1#2#3 {#3,#2,#1} % \end{verbatim} % Inside the \pkg{array} package, everything should behave as normal % under traditional \LaTeX\ but as soon as we are back at the top diff --git a/Master/texmf-dist/source/latex/expl3/l3prg.dtx b/Master/texmf-dist/source/latex/expl3/l3prg.dtx index 7e6f3f72e42..4933c79ecb5 100644 --- a/Master/texmf-dist/source/latex/expl3/l3prg.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3prg.dtx @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3prg.dtx 1545 2009-09-20 06:57:55Z joseph $ +\GetIdInfo$Id: l3prg.dtx 1677 2009-11-02 08:24:04Z joseph $ {L3 Experimental control structures} %\iffalse %<*driver> @@ -585,8 +585,8 @@ % The two functions the programmer must define before calling % |\prg_quicksort:n|. As an example we could define % \begin{quote} -% |\cs_set_nopar:Nn\prg_quicksort_function:n {{#1}}|\\ -% |\cs_set_nopar:Nn\prg_quicksort_compare:nnTF {\intexpr_compare:nNnTF{#1}>{#2}}| +% |\cs_set_nopar:Npn\prg_quicksort_function:n #1{{#1}}|\\ +% |\cs_set_nopar:Npn\prg_quicksort_compare:nnTF #1#2#3#4 {\intexpr_compare:nNnTF{#1}>{#2}}| % \end{quote} % Then the function call % \begin{quote} @@ -596,7 +596,7 @@ % where one sorts a list of words, |\prg_quicksort_compare:nnTF| could % be defined as % \begin{quote} -% |\cs_set_nopar:Nn\prg_quicksort_compare:nnTF {|\\ +% |\cs_set_nopar:Npn\prg_quicksort_compare:nnTF #1#2 {|\\ % | \intexpr_compare:nNnTF{\tl_compare:nn{#1}{#2}}>\c_zero }| % \end{quote} % @@ -1717,7 +1717,7 @@ \tex_catcode:D `\& = \c_twelve \tex_relax:D \tl_to_lowercase:n { \group_end: - \cs_new_nopar:Nn \prg_variable_get_scope:N { + \cs_new_nopar:Npn \prg_variable_get_scope:N #1 { \exp_last_unbraced:Nf \prg_variable_get_scope_aux:w { \cs_to_str:N #1 \exp_stop_f: \q_nil } } @@ -1730,7 +1730,7 @@ \tex_catcode:D `\& = \c_twelve \tex_relax:D \tl_to_lowercase:n { \group_end: - \cs_new_nopar:Nn \prg_variable_get_type:N { + \cs_new_nopar:Npn \prg_variable_get_type:N #1 { \exp_after:wN \p;rg_variable_get_type_aux:w \token_to_str:N #1 & a \q_nil } diff --git a/Master/texmf-dist/source/latex/expl3/l3prop.dtx b/Master/texmf-dist/source/latex/expl3/l3prop.dtx index 73958e5fd56..9c93d32dcbc 100644 --- a/Master/texmf-dist/source/latex/expl3/l3prop.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3prop.dtx @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3prop.dtx 1536 2009-09-16 07:23:04Z joseph $ +\GetIdInfo$Id: l3prop.dtx 1622 2009-10-25 06:41:23Z will $ {L3 Experimental Property Lists} %\iffalse %<*driver> @@ -197,7 +197,10 @@ % "\prop_map_function:NN" <\proplist> <function> % \end{syntax} % Maps <function> which should be a function with two arguments (<\propkey> -% and <\propval>) over every <\propkey> <\propval> pair of <\proplist>. Expandable. +% and <\propval>) over every <\propkey> <\propval> pair of <\proplist>. +% Property lists do not have any intrinsic ``order'' when stored. As a +% result, you should not expect any particular order to apply when using +% these mapping functions, even with newly-created properly lists. % \end{function} % % \begin{function}{\prop_map_inline:Nn | @@ -209,6 +212,9 @@ % Just like "\prop_map_function:NN" but with the function of two arguments % supplied as inline code. Within <inline function> refer to the % arguments via "#1" (<\propkey>) and "#2" (<\propval>). Nestable. +% Property lists do not have any intrinsic ``order'' when stored. As a +% result, you should not expect any particular order to apply when using +% these mapping functions, even with newly-created properly lists. % \end{function} % % @@ -327,9 +333,9 @@ % \end{function} % % \begin{function}{% -% \g_prop_inline_level_num | +% \g_prop_inline_level_int | % } -% Fake integer used in internal name for function used inside +% Integer used in internal name for function used inside % "\prop_map_inline:NN". % \end{function} % @@ -806,22 +812,22 @@ % % \begin{macro}{\prop_map_inline:Nn} % \begin{macro}{\prop_map_inline:cn} -% \begin{macro}{\g_prop_inline_level_num} +% \begin{macro}{\g_prop_inline_level_int} % The inline functions are straight forward. It takes longer % to test if the list is empty than to run it on an empty list so % we don't waste time doing that. % \begin{macrocode} -\num_new:N \g_prop_inline_level_num +\int_new:N \g_prop_inline_level_int \cs_new_nopar:Npn \prop_map_inline:Nn #1#2 { - \num_gincr:N \g_prop_inline_level_num - \cs_gset:cpn {prop_map_inline_ \num_use:N \g_prop_inline_level_num :n} + \int_gincr:N \g_prop_inline_level_int + \cs_gset:cpn {prop_map_inline_ \int_use:N \g_prop_inline_level_int :n} ##1##2{#2} \prop_map_function:Nc #1 - {prop_map_inline_ \num_use:N \g_prop_inline_level_num :n} - \num_gdecr:N \g_prop_inline_level_num + {prop_map_inline_ \int_use:N \g_prop_inline_level_int :n} + \int_gdecr:N \g_prop_inline_level_int } % \end{macrocode} -% +% % \begin{macrocode} \cs_generate_variant:Nn\prop_map_inline:Nn {cn} % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/expl3/l3seq.dtx b/Master/texmf-dist/source/latex/expl3/l3seq.dtx index 4c06643d19b..4ce306b7d41 100644 --- a/Master/texmf-dist/source/latex/expl3/l3seq.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3seq.dtx @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3seq.dtx 1415 2009-06-17 19:37:24Z will $ +\GetIdInfo$Id: l3seq.dtx 1692 2009-11-03 21:02:34Z joseph $ {L3 Experimental sequences and stacks} %\iffalse %<*driver> @@ -331,6 +331,7 @@ % \end{function} % % \begin{function}{ \seq_if_in:Nn / (TF) | +% \seq_if_in:NV / (TF) | % \seq_if_in:cn / (TF) | % \seq_if_in:cV / (TF) | % \seq_if_in:co / (TF) | @@ -583,7 +584,7 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[TF]{\seq_if_in:Nn,\seq_if_in:cn, +% \begin{macro}[TF]{\seq_if_in:Nn,\seq_if_in:NV,\seq_if_in:cn, % \seq_if_in:cV,\seq_if_in:co,\seq_if_in:cx} % |\seq_if_in:NnTF| \m{seq}\m{item} \m{true~case} \m{false~case} % will check whether \m{item} is in \m{seq} and then either execute @@ -603,9 +604,9 @@ } % \end{macrocode} % \begin{macrocode} -\cs_generate_variant:Nn \seq_if_in:NnTF {cV,co,c,cx} -\cs_generate_variant:Nn \seq_if_in:NnT {cV,co,c,cx} -\cs_generate_variant:Nn \seq_if_in:NnF {cV,co,c,cx} +\cs_generate_variant:Nn \seq_if_in:NnTF { NV, cV, co, c, cx} +\cs_generate_variant:Nn \seq_if_in:NnT { NV, cV, co, c, cx} +\cs_generate_variant:Nn \seq_if_in:NnF { NV, cV, co, c, cx} % \end{macrocode} % \end{macro} % @@ -888,12 +889,12 @@ % \begin{macro}{\seq_gremove_duplicates:N} % Copied from "\clist_remove_duplicates". % \begin{macrocode} -\cs_new:Nn \seq_remove_duplicates_aux:NN { +\cs_new:Npn \seq_remove_duplicates_aux:NN #1#2 { \seq_clear:N \l_seq_remove_seq \seq_map_function:NN #2 \seq_remove_duplicates_aux:n #1 #2 \l_seq_remove_seq } -\cs_new:Nn \seq_remove_duplicates_aux:n { +\cs_new:Npn \seq_remove_duplicates_aux:n #1 { \seq_if_in:NnF \l_seq_remove_seq {#1} { \seq_put_right:Nn \l_seq_remove_seq {#1} } diff --git a/Master/texmf-dist/source/latex/expl3/l3tl.dtx b/Master/texmf-dist/source/latex/expl3/l3tl.dtx index 24d4ba86672..3e478643e76 100644 --- a/Master/texmf-dist/source/latex/expl3/l3tl.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3tl.dtx @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3tl.dtx 1505 2009-09-03 20:29:19Z joseph $ +\GetIdInfo$Id: l3tl.dtx 1621 2009-10-25 06:36:19Z will $ {L3 Experimental Token Lists} %\iffalse %<*driver> @@ -603,7 +603,7 @@ % \end{variable} % % \begin{variable}{% -% \g_tl_inline_level_num | +% \g_tl_inline_level_int | % } % Internal register used in the inline map functions. % \end{variable}% @@ -1664,33 +1664,31 @@ % \begin{macro}{\tl_map_inline:Nn} % \begin{macro}{\tl_map_inline:cn} % \begin{macro}[aux]{\tl_map_inline_aux:n} -% \begin{macro}{\g_tl_inline_level_num} +% \begin{macro}{\g_tl_inline_level_int} % The inline functions are straight forward by now. We use a little -% trick with the fake counter |\g_tl_inline_level_num| to make -% them nestable.\footnote{This should be a proper integer, but I -% don't want to mess with the dependencies right now\dots} We can +% trick with the counter |\g_tl_inline_level_int| to make +% them nestable. We can % also make use of |\tl_map_function:Nn| from before. % \begin{macrocode} \cs_new:Npn \tl_map_inline:nn #1#2{ - \num_gincr:N \g_tl_inline_level_num - \cs_gset:cpn {tl_map_inline_ \num_use:N \g_tl_inline_level_num :n} + \int_gincr:N \g_tl_inline_level_int + \cs_gset:cpn {tl_map_inline_ \int_use:N \g_tl_inline_level_int :n} ##1{#2} \exp_args:Nc \tl_map_function_aux:Nn - {tl_map_inline_ \num_use:N \g_tl_inline_level_num :n} + {tl_map_inline_ \int_use:N \g_tl_inline_level_int :n} #1 \q_recursion_tail\q_recursion_stop - \num_gdecr:N \g_tl_inline_level_num + \int_gdecr:N \g_tl_inline_level_int } \cs_new:Npn \tl_map_inline:Nn #1#2{ - \num_gincr:N \g_tl_inline_level_num - \cs_gset:cpn {tl_map_inline_ \num_use:N \g_tl_inline_level_num :n} + \int_gincr:N \g_tl_inline_level_int + \cs_gset:cpn {tl_map_inline_ \int_use:N \g_tl_inline_level_int :n} ##1{#2} \exp_last_unbraced:NcV \tl_map_function_aux:Nn - {tl_map_inline_ \num_use:N \g_tl_inline_level_num :n} + {tl_map_inline_ \int_use:N \g_tl_inline_level_int :n} #1 \q_recursion_tail\q_recursion_stop - \num_gdecr:N \g_tl_inline_level_num + \int_gdecr:N \g_tl_inline_level_int } \cs_generate_variant:Nn \tl_map_inline:Nn {c} -\tl_new:Nn \g_tl_inline_level_num{0} % \end{macrocode} % \end{macro} % \end{macro} diff --git a/Master/texmf-dist/source/latex/expl3/source3.tex b/Master/texmf-dist/source/latex/expl3/source3.tex deleted file mode 100644 index 8a3459a1d60..00000000000 --- a/Master/texmf-dist/source/latex/expl3/source3.tex +++ /dev/null @@ -1,417 +0,0 @@ -% \iffalse -%% File: source3.dtx Copyright (C) 1990-2009 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/svnroot/experimental/trunk/ -%% -%% 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. -%% -%% ----------------------------------------------------------------------- -%% \fi - -% This document will typeset the LaTeX3 sources as a single document. -% This will produce quite a large file (roughly ??? pages) and may -% take a long time on a slow machine. - -\documentclass{l3doc} -\listfiles - -\begin{document} - -\title{The \LaTeX3 Sources} -\author{\Team} - - -\pagenumbering{roman} -\maketitle - -\begin{abstract} - -\parindent=0pt -\parskip=\baselineskip - -\noindent This is the reference documentation for the \pkg{expl3} -programming environment. The \pkg{expl3} modules set up an experimental -naming scheme for \LaTeX\ commands, which allow the \LaTeX\ programmer -to systematically name functions and variables, and specify the argument -types of functions. - -The \TeX\ and \eTeX\ primitives are all given a new name according to -these conventions. However, in the main direct use of the primitives is -not required or encouraged: the \pkg{expl3} modules define an -independent low-level \LaTeX3 programming language. - -At present, the \pkg{expl3} modules are designed to be loaded on top of -\LaTeXe. In time, a \LaTeX3 format will be produced based on this code. -This allows the code to be used in \LaTeXe\ packages \emph{now} while a -stand-alone \LaTeX3 is developed. - -\begin{bfseries} - While \pkg{expl3} is still experimental, the bundle is now regarded as - broadly stable. The syntax conventions and functions provided are now - ready for wider use. There may still be changes to some functions, but - these will be minor when compared to the scope of \pkg{expl3}. - - New modules will be added to the distributed version of \pkg{expl3} as - they reach maturity. -\end{bfseries} - -\end{abstract} - -\clearpage - -{\def\\{:}% fix "newlines" in the ToC -\tableofcontents} - -\clearpage -\pagenumbering{arabic} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% Each of the following \DocInput lines includes a file with extension -% .dtx. Each of these files may be typeset separately. For instance -% pdflatex l3box.dtx -% will typeset the source of the LaTeX3 box commands. If you use the -% Makefile, the index will be generated automatically; e.g., -% make doc F=l3box -% -% If this file is processed, each of these separate dtx files will be -% contained as a part of a single document. - -\makeatletter -\def\partname{Part} -\def\maketitle{\part{\@title}} -\let\thanks\@gobble -\let\DelayPrintIndex\PrintIndex -\let\PrintIndex\@empty -\makeatother - -\part{Introduction to \pkg{expl3} and this document} - -This document is intended to act as a comprehensive reference manual -for the \pkg{expl3} language. A general guide to the \LaTeX3 -programming language is found in \href{expl3.pdf}{expl3.pdf}. - -\section{Naming functions and variables} - -\LaTeX3 does not use \texttt{@} as a ``letter'' for defining -internal macros. Instead, the symbols |_| and \texttt{:} -are used in internal macro names to provide structure. The name of -each \emph{function} is divided into logical units using \texttt{_}, -while \texttt{:} separates the \emph{name} of the function from the -\emph{argument specifier} (``arg-spec''). This describes the arguments -expected by the function. In most cases, each argument is represented -by a single letter. The complete list of arg-spec letters for a function -is referred to as the \emph{signature} of the function. - -Each function name starts with the \emph{module} to which it belongs. -Thus apart from a small number of very basic functions, all \pkg{expl3} -function names contain at least one underscore to divide the module -name from the descriptive name of the function. For example, all -functions concerned with comma lists are in module \texttt{clist} and -begin \cs{clist_}. - -Every function must include an argument specifier. For functions which -take no arguments, this will be blank and the function name will end -\texttt{:}. Most functions take one or more arguments, and use the -following argument specifiers: -\begin{description} - \item[\texttt{D}] The \texttt{D} specifier means \emph{do not use}. - All of the \TeX\ primitives are initially \cs{let} to a \texttt{D} - name, and some are then given a second name. Only the kernel - team should use anything with a \texttt{D} specifier! - \item[\texttt{N} and \texttt{n}] These mean \emph{no manipulation}, - of a single token for \texttt{N} and of a set of tokens given in - braces for \texttt{n}. Both pass the argument though exactly as - given. Usually, if you use a single token for an \texttt{n} argument, - all will be well. - \item[\texttt{c}] This means \emph{csname}, and indicates that the - argument will be turned into a csname before being used. So - So \cs{foo:c} |{ArgumentOne}| will act in the same way as \cs{foo:N} - \cs{ArgumentOne}. - \item[\texttt{V} and \texttt{v}] These mean \emph{value - of variable}. The \texttt{V} and \texttt{v} specifiers are used to - get the content of a variable without needing to worry about the - underlying \TeX\ structure containing the data. A \texttt{V} - argument will be a single token (similar to \texttt{N}), for example - \cs{foo:V} \cs{MyVariable}; on the other hand, using \texttt{v} a - csname is constructed first, and then the value is recovered, for - example \cs{foo:v} |{MyVariable}|. - \item[\texttt{o}] This means \emph{expansion once}. In general, the - \texttt{V} and \texttt{v} specifiers are favoured over \texttt{o} - for recovering stored information. However, \texttt{o} is useful - for correctly processing information with delimited arguments. - \item[\texttt{x}] The \texttt{x} specifier stands for \emph{exhaustive - expansion}: the plain \TeX\ \cs{edef}. - \item[\texttt{f}] The \texttt{f} specifier stands for \emph{full - expansion}, and in contrast to \emph{x} stops at the first - non-expandable item without trying to execute it. - \item[\texttt{T} and \texttt{F}] For logic tests, there are the branch - specifiers \texttt{T} (\emph{true}) and \texttt{F} (\emph{false}). - Both specifiers treat the input in the same way as \texttt{n} (no - change), but make the logic much easier to see. - \item[\texttt{p}] The letter \texttt{p} indicates \TeX\ - \emph{parameters}. Normally this will be used for delimited - functions as \pkg{expl3} provides better methods for creating simple - sequential arguments. - \item[\texttt{w}] Finally, there is the \texttt{w} specifier for - \emph{weird} arguments. This covers everything else, but mainly - applies to delimited values (where the argument must be terminated - by some arbitrary string). -\end{description} -Notice that the argument specifier describes how the argument is -processed prior to being passed to the underlying function. For example, -\cs{foo:c} will take its argument, convert it to a control sequence and -pass it to \cs{foo:N}. - -Variables are named in a similar manner to functions, but begin with -a single letter to define the type of variable: -\begin{description} - \item[\texttt{c}] Constant: global parameters whose value should not - be changed. - \item[\texttt{g}] Parameters whose value should only be set globally. - \item[\texttt{l}] Parameters whose value should only be set locally. -\end{description} -Each variable name is then build up in a similar way to that of a -function, typically starting with the module\footnote{The module names are - not used in case of generic scratch registers defined in the data - type modules, e.g., the - \texttt{int} module contains some scratch variables called \cs{l_tmpa_int}, - \cs{l_tmpb_int}, and so on. In such a case adding the module name up front - to denote the module - and in the back to indicate the type, as in - \cs{l_int_tmpa_int} would be very unreadable.} name -and then a descriptive part. -Variables end with a short identifier to show the variable type: -\begin{description} - \item[\texttt{bool}] Either true or false. - \item[\texttt{box}] Box register. - \item[\texttt{clist}] Comma separated list. - \item[\texttt{dim}] `Rigid' lengths. - \item[\texttt{int}] Integer-valued count register. - \item[\texttt{num}] A `fake' integer type using only macros. Useful for - setting up allocation routines. - \item[\texttt{prop}] Property list. - \item[\texttt{skip}] `Rubber' lengths. - \item[\texttt{seq}] `Sequence': a data-type used to implement lists - (with access at both ends) and stacks. - \item[\texttt{stream}] An input or output stream (for reading from or - writing to, respectively). - \item[\texttt{tl}] Token list variables: placeholder for a token list. - \item[\texttt{toks}] Token register. -\end{description} - -\subsubsection{Terminological inexactitude} - -A word of warning. In this document, and others referring to the \pkg{expl3} -programming modules, we often refer to `variables' and `functions' as if -they were actual constructs from a real programming language. -In truth, \TeX\ is a macro processor, and functions are simply macros that -may or mayn't take arguments and expand to their replacement text. -Many of the common variables are \emph{also} macros, and if placed into the -input stream will simply expand to their definition as well~--- a `function' -with no arguments and a `token list variable' are in truth one and the same. -On the other hand, some `variables' are actually registers that must be initialised and their values set and retreived with specific functions. - -The conventions of the \pkg{expl3} code are designed to clearly separate the -ideas of `macros that contain data' and `macros that contain code', and a consistent wrapper is applied to all forms of `data' whether they be macros or actually registers. -This means that sometimes we will use phrases like `the function returns a value', when actually we just mean `the macro expands to something'. Similarly, the term `execute' might be used in place of `expand' or it might refer to the more specific case of `processing in \TeX's stomach' (if you are familiar with the \TeX{}book parlance). - -If in doubt, please ask; chances are we've been hasty in writing certain definitions and need to be told to tighten up our terminology. - -\section{Documentation conventions} - -This document is typeset with the experimental \pkg{l3doc} class; -several conventions are used to help describe the features of the code. -A number of conventions are used here to make the documentation clearer. - -Each group of related functions is given in a box. For a function with -a ``user'' name, this might read: -\begin{function}{ - \ExplSyntaxOn | - \ExplSyntaxOff - } - \begin{syntax} - "\ExplSyntaxOn" \dots\ "\ExplSyntaxOff" - \end{syntax} - The textual description of how the function works would appear here. The - syntax of the function is shown in mono-spaced text to the right of - the box. In this example, the function takes no arguments and so the - name of the function is simply reprinted. -\end{function} - -For programming functions, which use \texttt{_} and \texttt{:} in their -name there are a few additional conventions: If two related functions are given with identical names but -different argument specifiers, these are termed \emph{variants} of each -other, and the latter functions are printed in grey to show this more -clearly. They will carry out the same function but will take different -types of argument: -\begin{function}{ - \seq_new:N | - \seq_new:c - } - \begin{syntax} - "\seq_new:N" <sequence> - \end{syntax} - When a number of variants are described, the arguments are usually - illustrated only for the base function. Here, <sequence> indicates - that \cs{seq_new:N} expects the name of a sequence. From the argument - specifier, \cs{seq_new:c} also expects a sequence name, but as a - name rather than as a control sequence. Each argument given in the - illustration should be described in the following text. -\end{function} - -Some functions are fully expandable, which allows it to be used within -an \texttt{x}-type argument (in plain \TeX\ terms, inside an \cs{edef}). -These fully expandable functions are indicated in the documentation by -a star: -\begin{function}{ - \cs_to_str:N / (EXP) - } - \begin{syntax} - "\cs_to_str:N" <cs> - \end{syntax} - As with other functions, some text should follow which explains how - the function works. Usually, only the star will indicate that the - function is expandable. In this case, the function expects a <cs>, - shorthand for a <control sequence>. -\end{function} - -Conditional (\texttt{if}) functions are normally defined in three variants, with -\texttt{T}, \texttt{F} and \texttt{TF} argument specifiers. This allows -them to be used for different `true'/`false' branches, depending on -which outcome the conditional is being used to test. To indicate this -without repetition, this information is given in a shortened form: -\begin{function}{ - \xetex_if_engine: / (TF) (EXP) - } - \begin{syntax} - "\xetex_if_engine:TF" <true code> <false code> - \end{syntax} - The underlining and italic of \texttt{TF} indicates that - \cs{xetex_if_engine:T}, \cs{xetex_if_engine:F} and - \cs{xetex_if_engine:TF} are all available. Usually, the illustration - will use the \texttt{TF} variant, and so both <true code> - and <false code> will be shown. The two variant forms \texttt{T} and - \texttt{F} take only <true code> and <false code>, respectively. - Here, the star also shows that this function is expandable. - With some minor exceptions, \emph{all} conditional functions in the - \pkg{expl3} modules should be defined in this way. -\end{function} - -Variables, constants and so on are described in a similar manner: -\begin{variable}{ - \l_tmpa_tl - } - A short piece of text will describe the variable: there is no - syntax illustration in this case. -\end{variable} - -In some cases, the function is similar to one in \LaTeXe\ or plain \TeX. -In these cases, the text will include an extra `\textbf{\TeX{}hackers -note}' section: -\begin{function}{ - \token_to_str:N / (EXP) - } - \begin{syntax} - "\token_to_str:N" <token> - \end{syntax} - The normal description text. - \begin{texnote} - Detail for the experienced \TeX\ or \LaTeXe\ programmer. In this - case, it would point out that this function is the \TeX\ primitive - \cs{string}. - \end{texnote} -\end{function} - -\DisableImplementation - -\DocInput{l3names.dtx} - -\DocInput{l3basics.dtx} -\DocInput{l3expan.dtx} -\DocInput{l3prg.dtx} -\DocInput{l3quark.dtx} -\DocInput{l3token.dtx} - -\DocInput{l3int.dtx} -\DocInput{l3num.dtx} -\DocInput{l3intexpr.dtx} -\DocInput{l3skip.dtx} - -\DocInput{l3tl.dtx} -\DocInput{l3toks.dtx} -\DocInput{l3seq.dtx} -\DocInput{l3clist.dtx} -\DocInput{l3prop.dtx} - -\DocInput{l3io.dtx} -\DocInput{l3msg.dtx} -\DocInput{l3box.dtx} -\DocInput{l3xref.dtx} -\DocInput{l3keyval.dtx} -\DocInput{l3keys.dtx} -\DocInput{l3calc.dtx} -\DocInput{l3file.dtx} - -% \DocInput{l3precom.dtx} -% \DocInput{l3alloc.dtx} -% \DocInput{l3chk.dtx} - -\part{Implementation} -\def\maketitle{} -\EnableImplementation -\DisableDocumentation -\DocInputAgain - -%% \DocInput{l3vers.dtx} % Current version date - -\includeltpatch % Corrections distributed after the full release - -\clearpage -\pagestyle{headings} - -% Make TeX shut up. -\hbadness=10000 -\newcount\hbadness -\hfuzz=\maxdimen - -\PrintChanges -\clearpage - -\begingroup -\def\endash{--} -\catcode`\-\active -\def-{\futurelet\temp\indexdash} -\def\indexdash{\ifx\temp-\endash\fi} - -\DelayPrintIndex -\endgroup - -\end{document} - - |