[latex3-commits] [git/LaTeX3-latex3-latex3] master: Move __kernel functions to a separate file (444a850)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Apr 2 19:03:17 CEST 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/444a850dde6ae471bf4037be2a1304e4d6f963f2

>---------------------------------------------------------------

commit 444a850dde6ae471bf4037be2a1304e4d6f963f2
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Apr 2 17:35:09 2018 +0100

    Move __kernel functions to a separate file


>---------------------------------------------------------------

444a850dde6ae471bf4037be2a1304e4d6f963f2
 l3kernel/l3basics.dtx           |  184 +---------------
 l3kernel/l3file.dtx             |   56 -----
 l3kernel/l3kernel-functions.dtx |  444 +++++++++++++++++++++++++++++++++++++++
 l3kernel/l3msg.dtx              |  146 -------------
 l3kernel/l3str.dtx              |   21 --
 l3kernel/l3token.dtx            |   14 --
 l3kernel/source3body.tex        |    3 +
 7 files changed, 448 insertions(+), 420 deletions(-)

diff --git a/l3kernel/l3basics.dtx b/l3kernel/l3basics.dtx
index 9aa4444..3d93b65 100644
--- a/l3kernel/l3basics.dtx
+++ b/l3kernel/l3basics.dtx
@@ -1150,16 +1150,7 @@
 %
 % \section{Internal kernel functions}
 %
-% \begin{function}{\__kernel_chk_if_free_cs:N, \__kernel_chk_if_free_cs:c}
-%   \begin{syntax}
-%     \cs{__kernel_chk_if_free_cs:N} \meta{cs}
-%   \end{syntax}
-%   This function checks that \meta{cs} is free according to the
-%   criteria for \cs{cs_if_free_p:N}, and if not raises a kernel-level
-%   error.
-% \end{function}
-%
-% \begin{function}[EXP]{\__cs_count_signature:N, \__cs_count_signature:c}
+% \begin{function}{\__cs_count_signature:N}
 %   \begin{syntax}
 %     \cs{__cs_count_signature:N} \meta{function}
 %   \end{syntax}
@@ -1213,179 +1204,6 @@
 %   normally (spaces, characters with category other).
 % \end{function}
 %
-% \begin{function}{\__kernel_debug:TF}
-%   \begin{syntax}
-%     \cs{__kernel_debug:TF} \Arg{true code} \Arg{false code}
-%   \end{syntax}
-%   Runs the \meta{true code} if debugging is enabled, namely only in
-%   \LaTeXe{} package mode with one of the options
-%   \texttt{check-declarations}, \texttt{enable-debug}, or
-%   \texttt{log-functions}.  Otherwise runs the \meta{false code}.  The
-%   |T| and |F| variants are not provided for this low-level
-%   conditional.
-% \end{function}
-%
-% \begin{function}{\__kernel_chk_cs_exist:N, \__kernel_chk_cs_exist:c}
-%   \begin{syntax}
-%     \cs{__kernel_chk_cs_exist:N} \meta{cs}
-%   \end{syntax}
-%   This function is only created if debugging is enabled.  It checks
-%   that \meta{cs} exists according to the criteria for
-%   \cs{cs_if_exist_p:N}, and if not raises a kernel-level error.
-% \end{function}
-%
-% \begin{function}{\__kernel_chk_expr:nNnN}
-%   \begin{syntax}
-%     \cs{__kernel_chk_expr:nNnN} \Arg{expr} \meta{eval} \Arg{convert} \meta{caller}
-%   \end{syntax}
-%   This function is only created if debugging is enabled.  By default
-%   it is equivalent to \cs{use_i:nnnn}.  When expression checking is
-%   enabled, it leaves in the input stream the result of \cs{tex_the:D}
-%   \meta{eval} \meta{expr} \cs{tex_relax:D} after checking that no
-%   token was left over.  If any token was not taken as part of the
-%   expression, there is an error message displaying the result of the
-%   evaluation as well as the \meta{caller}.  For instance \meta{eval}
-%   can be \cs{__int_eval:w} and \meta{caller} can be \cs{int_eval:n} or
-%   \cs{int_set:Nn}.  The argument \meta{convert} is empty except for mu
-%   expressions where it is \cs{etex_mutoglue:D}, used for internal
-%   purposes.
-% \end{function}
-%
-% \begin{function}{\__kernel_chk_var_exist:N}
-%   \begin{syntax}
-%     \cs{__kernel_chk_var_exist:N} \meta{var}
-%   \end{syntax}
-%   This function is only created if debugging is enabled.  It checks
-%   that \meta{var} is defined according to the criteria for
-%   \cs{cs_if_exist_p:N}, and if not raises a kernel-level error.
-% \end{function}
-%
-% \begin{function}{\__kernel_chk_var_scope:NN}
-%   \begin{syntax}
-%     \cs{__kernel_chk_var_scope:NN} \meta{scope} \meta{var}
-%   \end{syntax}
-%   Checks the \meta{var} has the correct \meta{scope}, and if not
-%   raises a kernel-level error.  This function is only created if
-%   debugging is enabled.  The \meta{scope} is a single letter |l|, |g|,
-%   |c| denoting local variables, global variables, or constants.  More
-%   precisely, if the variable name starts with a letter and an
-%   underscore (normal \pkg{expl3} convention) the function checks that
-%   this single letter matches the \meta{scope}.  Otherwise the function
-%   cannot know the scope \meta{var} the first time: instead, it defines
-%   |\__debug_chk_/|\meta{var name} to store that information for the
-%   next call.  Thus, if a given \meta{var} is subject to assignments of
-%   different scopes a kernel error will result.
-% \end{function}
-%
-% \begin{function}{\__kernel_chk_var_local:N, \__kernel_chk_var_global:N}
-%   \begin{syntax}
-%     \cs{__kernel_chk_var_local:N} \meta{var}
-%     \cs{__kernel_chk_var_global:N} \meta{var}
-%   \end{syntax}
-%   Applies \cs{__kernel_chk_var_exist:N} \meta{var}, then
-%   \cs{__kernel_chk_var_scope:NN} \meta{scope} \meta{var}, where
-%   \meta{scope} is |l| or~|g|.
-% \end{function}
-%
-% \begin{function}{\__kernel_debug_log:x}
-%   \begin{syntax}
-%     \cs{__kernel_debug_log:x} \Arg{message text}
-%   \end{syntax}
-%   If the \texttt{log-functions} option is active, this function writes
-%   the \meta{message text} to the log file using \cs{iow_log:x}.
-%   Otherwise, the \meta{message text} is ignored using \cs{use_none:n}.
-%   This function is only created if debugging is enabled.
-% \end{function}
-%
-% \begin{function}{\__kernel_patch:nnNNpn}
-%   \begin{syntax}
-%     \cs{__kernel_patch:nnNNpn} \Arg{before} \Arg{after}
-%     \meta{definition} \meta{function} \meta{parameters} \Arg{code}
-%   \end{syntax}
-%   If debugging is not enabled, this function ignores the \meta{before}
-%   and \meta{after} code and performs the \meta{definition} with no
-%   patching.  Otherwise it replaces \meta{code} by \meta{before}
-%   \meta{code} \meta{after} (which can involve |#1| and so on) in the
-%   \meta{definition} that follows.  The \meta{definition} must start
-%   with \cs{cs_new:Npn} or \cs{cs_set:Npn} or \cs{cs_gset:Npn} or their
-%   \texttt{_protected} counterparts.  Other cases can be added as
-%   needed.
-% \end{function}
-%
-% \begin{function}{\__kernel_patch_conditional:nNNpnn}
-%   \begin{syntax}
-%     \cs{__kernel_patch_conditional:nNNpnn} \Arg{before}
-%     \meta{definition} \meta{conditional} \meta{parameters} \Arg{type} \Arg{code}
-%   \end{syntax}
-%   Similar to \cs{__kernel_patch:nnNNpn} for conditionals, namely
-%   \meta{definition} must be \cs{prg_new_conditional:Npnn} or its
-%   \texttt{_protected} counterpart.  There is no \meta{after} code
-%   because that would interfere with the action of the conditional.
-% \end{function}
-%
-% \begin{function}
-%   {\__kernel_patch_args:nNNpn, \__kernel_patch_conditional_args:nNNpnn}
-%   \begin{syntax}
-%     \cs{__kernel_patch_args:nNNpn} \Arg{arguments}
-%     \meta{definition} \meta{function} \meta{parameters} \Arg{code}
-%   \end{syntax}
-%   Like \cs{__kernel_patch:nnNNpn}, this tweaks the following
-%   definition, but from the \enquote{inside out} (and if debugging is
-%   not enabled, the \meta{arguments} are ignored).  It replaces |#1|,
-%   |#2| and so on in the \meta{code} of the definition as indicated by
-%   the \meta{arguments}.  More precisely, a temporary function is
-%   defined using the \meta{definition} with the \meta{parameters} and
-%   \meta{code}, then the result of expanding that function once in
-%   front of the \meta{arguments} is used instead of the \meta{code}
-%   when defining the actual function.  For instance,
-%   \begin{quote}
-%     \cs{__kernel_patch_args:nNNpn} |{ { (#1) } }| \\
-%     \cs{cs_new:Npn} \cs{int_eval:n} |#1| \\
-%     ~~|{ \int_value:w \__int_eval:w #1 \__int_eval_end: }|
-%   \end{quote}
-%   would replace |#1| by |(#1)| in the definition of \cs{int_eval:n} when
-%   debugging is enabled.  This fails if the \meta{code} contains~|##|.
-%   The \cs{__kernel_patch_conditional_args:nNNpnn} function is for use
-%   before \cs{prg_new_conditional:Npnn} or its \texttt{_protected}
-%   counterpart.
-% \end{function}
-%
-% \begin{function}
-%   {\__kernel_patch_args:nnnNNpn, \__kernel_patch_conditional_args:nnnNNpnn}
-%   \begin{syntax}
-%     \cs{__kernel_patch_args:nnnNNpn} \Arg{before} \Arg{after} \Arg{arguments}
-%     \meta{definition} \meta{function} \meta{parameters} \Arg{code}
-%   \end{syntax}
-%   A combination of \cs{__kernel_patch:nnNNpn} and
-%   \cs{__kernel_patch_args:nNNpn}.
-% \end{function}
-%
-% \begin{function}{\__kernel_check_defined:NT}
-%   \begin{syntax}
-%     \cs{__kernel_check_defined:NT} \meta{variable} \Arg{true code}
-%   \end{syntax}
-%   If \meta{variable} is not defined (according to
-%   \cs{cs_if_exist:NTF}), this triggers an error, otherwise the
-%   \meta{true code} is run.
-% \end{function}
-%
-% \begin{function}{\__kernel_register_show:N, \__kernel_register_show:c}
-%   \begin{syntax}
-%     \cs{__kernel_register_show:N} \meta{register}
-%   \end{syntax}
-%   Used to show the contents of a \TeX{} register at the terminal, formatted
-%   such that internal parts of the mechanism are not visible.
-% \end{function}
-%
-% \begin{function}[updated = 2015-08-03]
-%   {\__kernel_register_log:N, \__kernel_register_log:c}
-%   \begin{syntax}
-%     \cs{__kernel_register_log:N} \meta{register}
-%   \end{syntax}
-%   Used to write the contents of a \TeX{} register to the log file in a
-%   form similar to \cs{__kernel_register_show:N}.
-% \end{function}
-%
 % \end{documentation}
 %
 % \begin{implementation}
diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index 5af4d14..5ec1d2d 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -647,62 +647,6 @@
 %   \end{texnote}
 % \end{function}
 %
-% \subsection{Internal file functions and variables}
-%
-% \begin{function}{\__kernel_file_missing:n}
-%   \begin{syntax}
-%     \cs{__kernel_file_missing:n} \Arg{name}
-%   \end{syntax}
-%   Expands the \meta{name} as per \cs{__kernel_file_name_sanitize:nN} then
-%   produces an error message indicating that that file was not found.
-% \end{function}
-%
-% \begin{function}{\__kernel_file_name_sanitize:nN}
-%   \begin{syntax}
-%     \cs{__kernel_file_name_sanitize:nN} \Arg{name} \meta{str var}
-%   \end{syntax}
-%   For converting a \meta{name} to a string where active characters are treated
-%   as strings.
-% \end{function}
-%
-% \begin{function}{\__kernel_file_input_push:n, \__kernel_file_input_pop:}
-%   \begin{syntax}
-%     \cs{__kernel_file_input_push:n} \Arg{name}
-%     \cs{__kernel_file_input_pop:}
-%   \end{syntax}
-%   Used to push and pop data from the internal file stack: needed only
-%   in package mode, where interfacing with the \LaTeXe{} kernel is necessary.
-% \end{function}
-%
-% \subsection{Internal input--output functions}
-%
-% \begin{function}{\__kernel_ior_open:Nn, \__kernel_ior_open:No}
-%   \begin{syntax}
-%     \cs{__kernel_ior_open:Nn} \meta{stream} \Arg{file name}
-%   \end{syntax}
-%   This function has identical syntax to the public version. However,
-%   is does not take precautions against active characters in the
-%   \meta{file name}, and it does not attempt to add a \meta{path} to
-%   the \meta{file name}: it is therefore intended to be used by
-%   higher-level
-%   functions which have already fully expanded the \meta{file name} and which
-%   need to perform multiple open or close operations. See for example the
-%   implementation of \cs{file_get_full_name:nN},
-% \end{function}
-%
-% \begin{function}[added = 2014-08-23]{\__kernel_iow_with:Nnn}
-%   \begin{syntax}
-%     \cs{__kernel_iow_with:Nnn} \meta{integer} \Arg{value} \Arg{code}
-%   \end{syntax}
-%   If the \meta{integer} is equal to the \meta{value} then this
-%   function simply runs the \meta{code}.  Otherwise it saves the
-%   current value of the \meta{integer}, sets it to the \meta{value},
-%   runs the \meta{code}, and restores the \meta{integer} to its former
-%   value.  This is used to ensure that the \tn{newlinechar} is~$10$
-%   when writing to a stream, which lets \cs{iow_newline:} work, and
-%   that \tn{errorcontextlines} is $-1$ when displaying a message.
-% \end{function}
-%
 % \end{documentation}
 %
 % \begin{implementation}
diff --git a/l3kernel/l3kernel-functions.dtx b/l3kernel/l3kernel-functions.dtx
new file mode 100644
index 0000000..0cf1294
--- /dev/null
+++ b/l3kernel/l3kernel-functions.dtx
@@ -0,0 +1,444 @@
+% \iffalse meta-comment
+%
+%% File: l3kernel-functions.dtx Copyright (C) 2018 The 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
+%
+%    https://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+%    https://github.com/latex3/latex3
+%
+% for those people who are interested.
+%
+%<*driver>
+\documentclass[full,kernel]{l3doc}
+\begin{document}
+  \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \title{^^A
+%   The \pkg{l3kernel-functions} package\\ Kernel-reserved functions^^A
+% }
+%
+% \author{^^A
+%  The \LaTeX3 Project\thanks
+%    {^^A
+%      E-mail:
+%        \href{mailto:latex-team at latex-project.org}
+%          {latex-team at latex-project.org}^^A
+%    }^^A
+% }
+%
+% \date{Released 2018/03/05}
+%
+% \maketitle
+%
+% \begin{documentation}
+%
+% \end{documentation}
+%
+% \begin{implementation}
+%
+% \section{Internal kernel functions}
+%
+% \begin{function}[EXP]{\__kernel_char_generate:nn}
+%   \begin{syntax}
+%      \cs{__kernel_char_generate:nn} \Arg{charcode} \Arg{catcode}
+%   \end{syntax}
+%   This function is identical in operation to the public
+%   \cs{char_generate:nn} but omits various sanity tests. In particular, this
+%   means it is used in certain places where engine variations need to be
+%   accounted for by the kernel.  The \meta{catcode} must give an explicit
+%   integer when expanded (and must not absorb a space for instance, nor
+%   be an integer variable).
+% \end{function}
+%
+% \begin{function}{\__kernel_chk_cs_exist:N, \__kernel_chk_cs_exist:c}
+%   \begin{syntax}
+%     \cs{__kernel_chk_cs_exist:N} \meta{cs}
+%   \end{syntax}
+%   This function is only created if debugging is enabled.  It checks
+%   that \meta{cs} exists according to the criteria for
+%   \cs{cs_if_exist_p:N}, and if not raises a kernel-level error.
+% \end{function}
+%
+% \begin{function}{\__kernel_check_defined:NT}
+%   \begin{syntax}
+%     \cs{__kernel_check_defined:NT} \meta{variable} \Arg{true code}
+%   \end{syntax}
+%   If \meta{variable} is not defined (according to
+%   \cs{cs_if_exist:NTF}), this triggers an error, otherwise the
+%   \meta{true code} is run.
+% \end{function}
+%
+% \begin{function}{\__kernel_chk_expr:nNnN}
+%   \begin{syntax}
+%     \cs{__kernel_chk_expr:nNnN} \Arg{expr} \meta{eval} \Arg{convert} \meta{caller}
+%   \end{syntax}
+%   This function is only created if debugging is enabled.  By default
+%   it is equivalent to \cs{use_i:nnnn}.  When expression checking is
+%   enabled, it leaves in the input stream the result of \cs{tex_the:D}
+%   \meta{eval} \meta{expr} \cs{tex_relax:D} after checking that no
+%   token was left over.  If any token was not taken as part of the
+%   expression, there is an error message displaying the result of the
+%   evaluation as well as the \meta{caller}.  For instance \meta{eval}
+%   can be \cs{__int_eval:w} and \meta{caller} can be \cs{int_eval:n} or
+%   \cs{int_set:Nn}.  The argument \meta{convert} is empty except for mu
+%   expressions where it is \cs{etex_mutoglue:D}, used for internal
+%   purposes.
+% \end{function}
+%
+% \begin{function}{\__kernel_chk_var_exist:N}
+%   \begin{syntax}
+%     \cs{__kernel_chk_var_exist:N} \meta{var}
+%   \end{syntax}
+%   This function is only created if debugging is enabled.  It checks
+%   that \meta{var} is defined according to the criteria for
+%   \cs{cs_if_exist_p:N}, and if not raises a kernel-level error.
+% \end{function}
+%
+% \begin{function}{\__kernel_chk_var_scope:NN}
+%   \begin{syntax}
+%     \cs{__kernel_chk_var_scope:NN} \meta{scope} \meta{var}
+%   \end{syntax}
+%   Checks the \meta{var} has the correct \meta{scope}, and if not
+%   raises a kernel-level error.  This function is only created if
+%   debugging is enabled.  The \meta{scope} is a single letter |l|, |g|,
+%   |c| denoting local variables, global variables, or constants.  More
+%   precisely, if the variable name starts with a letter and an
+%   underscore (normal \pkg{expl3} convention) the function checks that
+%   this single letter matches the \meta{scope}.  Otherwise the function
+%   cannot know the scope \meta{var} the first time: instead, it defines
+%   |\__debug_chk_/|\meta{var name} to store that information for the
+%   next call.  Thus, if a given \meta{var} is subject to assignments of
+%   different scopes a kernel error will result.
+% \end{function}
+%
+% \begin{function}{\__kernel_chk_var_local:N, \__kernel_chk_var_global:N}
+%   \begin{syntax}
+%     \cs{__kernel_chk_var_local:N} \meta{var}
+%     \cs{__kernel_chk_var_global:N} \meta{var}
+%   \end{syntax}
+%   Applies \cs{__kernel_chk_var_exist:N} \meta{var}, then
+%   \cs{__kernel_chk_var_scope:NN} \meta{scope} \meta{var}, where
+%   \meta{scope} is |l| or~|g|.
+% \end{function}
+%
+% \begin{function}{\__kernel_debug:TF}
+%   \begin{syntax}
+%     \cs{__kernel_debug:TF} \Arg{true code} \Arg{false code}
+%   \end{syntax}
+%   Runs the \meta{true code} if debugging is enabled, namely only in
+%   \LaTeXe{} package mode with one of the options
+%   \texttt{check-declarations}, \texttt{enable-debug}, or
+%   \texttt{log-functions}.  Otherwise runs the \meta{false code}.  The
+%   |T| and |F| variants are not provided for this low-level
+%   conditional.
+% \end{function}
+%
+% \begin{function}{\__kernel_debug_log:x}
+%   \begin{syntax}
+%     \cs{__kernel_debug_log:x} \Arg{message text}
+%   \end{syntax}
+%   If the \texttt{log-functions} option is active, this function writes
+%   the \meta{message text} to the log file using \cs{iow_log:x}.
+%   Otherwise, the \meta{message text} is ignored using \cs{use_none:n}.
+%   This function is only created if debugging is enabled.
+% \end{function}
+%
+% \begin{function}{\__kernel_file_missing:n}
+%   \begin{syntax}
+%     \cs{__kernel_file_missing:n} \Arg{name}
+%   \end{syntax}
+%   Expands the \meta{name} as per \cs{__kernel_file_name_sanitize:nN} then
+%   produces an error message indicating that that file was not found.
+% \end{function}
+%
+% \begin{function}{\__kernel_file_name_sanitize:nN}
+%   \begin{syntax}
+%     \cs{__kernel_file_name_sanitize:nN} \Arg{name} \meta{str var}
+%   \end{syntax}
+%   For converting a \meta{name} to a string where active characters are treated
+%   as strings.
+% \end{function}
+%
+% \begin{function}{\__kernel_file_input_push:n, \__kernel_file_input_pop:}
+%   \begin{syntax}
+%     \cs{__kernel_file_input_push:n} \Arg{name}
+%     \cs{__kernel_file_input_pop:}
+%   \end{syntax}
+%   Used to push and pop data from the internal file stack: needed only
+%   in package mode, where interfacing with the \LaTeXe{} kernel is necessary.
+% \end{function}
+%
+% \begin{function}{\__kernel_ior_open:Nn, \__kernel_ior_open:No}
+%   \begin{syntax}
+%     \cs{__kernel_ior_open:Nn} \meta{stream} \Arg{file name}
+%   \end{syntax}
+%   This function has identical syntax to the public version. However,
+%   is does not take precautions against active characters in the
+%   \meta{file name}, and it does not attempt to add a \meta{path} to
+%   the \meta{file name}: it is therefore intended to be used by
+%   higher-level
+%   functions which have already fully expanded the \meta{file name} and which
+%   need to perform multiple open or close operations. See for example the
+%   implementation of \cs{file_get_full_name:nN},
+% \end{function}
+%
+% \begin{function}{\__kernel_iow_with:Nnn}
+%   \begin{syntax}
+%     \cs{__kernel_iow_with:Nnn} \meta{integer} \Arg{value} \Arg{code}
+%   \end{syntax}
+%   If the \meta{integer} is equal to the \meta{value} then this
+%   function simply runs the \meta{code}.  Otherwise it saves the
+%   current value of the \meta{integer}, sets it to the \meta{value},
+%   runs the \meta{code}, and restores the \meta{integer} to its former
+%   value.  This is used to ensure that the \tn{newlinechar} is~$10$
+%   when writing to a stream, which lets \cs{iow_newline:} work, and
+%   that \tn{errorcontextlines} is $-1$ when displaying a message.
+% \end{function}
+%
+% \begin{function}
+%   {\__kernel_msg_new:nnnn, \__kernel_msg_new:nnn}
+%   \begin{syntax}
+%     \cs{__kernel_msg_new:nnnn} \Arg{module} \Arg{message} \Arg{text} \Arg{more text}
+%   \end{syntax}
+%   Creates a kernel \meta{message} for a given \meta{module}.
+%   The message is defined to first give \meta{text} and then
+%   \meta{more text} if the user requests it. If no \meta{more text} is
+%   available then a standard text is given instead. Within \meta{text}
+%   and \meta{more text} four parameters (|#1| to |#4|) can be used:
+%   these will be supplied and expanded at the time the message is used.
+%   An error is raised if the \meta{message} already exists.
+% \end{function}
+%
+% \begin{function}
+%   {\__kernel_msg_set:nnnn, \__kernel_msg_set:nnn}
+%   \begin{syntax}
+%     \cs{__kernel_msg_set:nnnn} \Arg{module} \Arg{message} \Arg{text} \Arg{more text}
+%   \end{syntax}
+%   Sets up the text for a kernel \meta{message} for a given \meta{module}.
+%   The message is defined to first give \meta{text} and then
+%   \meta{more text} if the user requests it. If no \meta{more text} is
+%   available then a standard text is given instead. Within \meta{text}
+%   and \meta{more text} four parameters (|#1| to |#4|) can be used:
+%   these will be supplied and expanded at the time the message is used.
+% \end{function}
+%
+% \begin{function}
+%   {
+%     \__kernel_msg_fatal:nnnnnn ,
+%     \__kernel_msg_fatal:nnnnn  ,
+%     \__kernel_msg_fatal:nnnn   ,
+%     \__kernel_msg_fatal:nnn    ,
+%     \__kernel_msg_fatal:nn     ,
+%     \__kernel_msg_fatal:nnxxxx ,
+%     \__kernel_msg_fatal:nnxxx  ,
+%     \__kernel_msg_fatal:nnxx   ,
+%     \__kernel_msg_fatal:nnx
+%   }
+%   \begin{syntax}
+%     \cs{__kernel_msg_fatal:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
+%   \end{syntax}
+%   Issues kernel \meta{module} error \meta{message}, passing \meta{arg one}
+%   to \meta{arg four} to the text-creating functions. After issuing a
+%   fatal error the \TeX{} run halts. Cannot be redirected.
+% \end{function}
+%
+% \begin{function}
+%   {
+%     \__kernel_msg_error:nnnnnn ,
+%     \__kernel_msg_error:nnnnn  ,
+%     \__kernel_msg_error:nnnn   ,
+%     \__kernel_msg_error:nnn    ,
+%     \__kernel_msg_error:nn     ,
+%     \__kernel_msg_error:nnxxxx ,
+%     \__kernel_msg_error:nnxxx  ,
+%     \__kernel_msg_error:nnxx   ,
+%     \__kernel_msg_error:nnx
+%   }
+%   \begin{syntax}
+%     \cs{__kernel_msg_error:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
+%   \end{syntax}
+%   Issues kernel \meta{module} error \meta{message}, passing \meta{arg one}
+%   to
+%   \meta{arg four} to the text-creating functions. The error
+%   stops processing and issues the text at the terminal. After user input,
+%   the run continues. Cannot be redirected.
+% \end{function}
+%
+% \begin{function}
+%   {
+%     \__kernel_msg_warning:nnnnnn ,
+%     \__kernel_msg_warning:nnnnn  ,
+%     \__kernel_msg_warning:nnnn   ,
+%     \__kernel_msg_warning:nnn    ,
+%     \__kernel_msg_warning:nn     ,
+%     \__kernel_msg_warning:nnxxxx ,
+%     \__kernel_msg_warning:nnxxx  ,
+%     \__kernel_msg_warning:nnxx   ,
+%     \__kernel_msg_warning:nnx
+%   }
+%   \begin{syntax}
+%     \cs{__kernel_msg_warning:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
+%   \end{syntax}
+%   Issues kernel \meta{module} warning \meta{message}, passing
+%   \meta{arg one} to
+%   \meta{arg four} to the text-creating functions. The warning text
+%   is added to the log file, but the \TeX{} run is not interrupted.
+% \end{function}
+%
+% \begin{function}
+%   {
+%     \__kernel_msg_info:nnnnnn ,
+%     \__kernel_msg_info:nnnnn  ,
+%     \__kernel_msg_info:nnnn   ,
+%     \__kernel_msg_info:nnn    ,
+%     \__kernel_msg_info:nn     ,
+%     \__kernel_msg_info:nnxxxx ,
+%     \__kernel_msg_info:nnxxx  ,
+%     \__kernel_msg_info:nnxx   ,
+%     \__kernel_msg_info:nnx
+%   }
+%   \begin{syntax}
+%     \cs{__kernel_msg_info:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
+%   \end{syntax}
+%   Issues kernel \meta{module} information \meta{message}, passing
+%   \meta{arg one} to \meta{arg four} to the text-creating functions.
+%   The information text is added to the log file.
+% \end{function}
+%
+% \begin{function}[EXP]
+%   {
+%     \__kernel_msg_expandable_error:nnnnnn,
+%     \__kernel_msg_expandable_error:nnnnn,
+%     \__kernel_msg_expandable_error:nnnn,
+%     \__kernel_msg_expandable_error:nnn,
+%     \__kernel_msg_expandable_error:nn,
+%     \__kernel_msg_expandable_error:nnffff,
+%     \__kernel_msg_expandable_error:nnfff,
+%     \__kernel_msg_expandable_error:nnff,
+%     \__kernel_msg_expandable_error:nnf,
+%   }
+%   \begin{syntax}
+%     \cs{__kernel_msg_expandable_error:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
+%   \end{syntax}
+%   Issues an error, passing \meta{arg one} to \meta{arg four}
+%   to the text-creating functions. The resulting string must
+%   be much shorter than a line, otherwise it is cropped.
+% \end{function}
+%
+% \begin{function}{\__kernel_patch:nnNNpn}
+%   \begin{syntax}
+%     \cs{__kernel_patch:nnNNpn} \Arg{before} \Arg{after}
+%     \meta{definition} \meta{function} \meta{parameters} \Arg{code}
+%   \end{syntax}
+%   If debugging is not enabled, this function ignores the \meta{before}
+%   and \meta{after} code and performs the \meta{definition} with no
+%   patching.  Otherwise it replaces \meta{code} by \meta{before}
+%   \meta{code} \meta{after} (which can involve |#1| and so on) in the
+%   \meta{definition} that follows.  The \meta{definition} must start
+%   with \cs{cs_new:Npn} or \cs{cs_set:Npn} or \cs{cs_gset:Npn} or their
+%   \texttt{_protected} counterparts.  Other cases can be added as
+%   needed.
+% \end{function}
+%
+% \begin{function}{\__kernel_patch_conditional:nNNpnn}
+%   \begin{syntax}
+%     \cs{__kernel_patch_conditional:nNNpnn} \Arg{before}
+%     \meta{definition} \meta{conditional} \meta{parameters} \Arg{type} \Arg{code}
+%   \end{syntax}
+%   Similar to \cs{__kernel_patch:nnNNpn} for conditionals, namely
+%   \meta{definition} must be \cs{prg_new_conditional:Npnn} or its
+%   \texttt{_protected} counterpart.  There is no \meta{after} code
+%   because that would interfere with the action of the conditional.
+% \end{function}
+%
+% \begin{function}
+%   {\__kernel_patch_args:nNNpn, \__kernel_patch_conditional_args:nNNpnn}
+%   \begin{syntax}
+%     \cs{__kernel_patch_args:nNNpn} \Arg{arguments}
+%     \meta{definition} \meta{function} \meta{parameters} \Arg{code}
+%   \end{syntax}
+%   Like \cs{__kernel_patch:nnNNpn}, this tweaks the following
+%   definition, but from the \enquote{inside out} (and if debugging is
+%   not enabled, the \meta{arguments} are ignored).  It replaces |#1|,
+%   |#2| and so on in the \meta{code} of the definition as indicated by
+%   the \meta{arguments}.  More precisely, a temporary function is
+%   defined using the \meta{definition} with the \meta{parameters} and
+%   \meta{code}, then the result of expanding that function once in
+%   front of the \meta{arguments} is used instead of the \meta{code}
+%   when defining the actual function.  For instance,
+%   \begin{quote}
+%     \cs{__kernel_patch_args:nNNpn} |{ { (#1) } }| \\
+%     \cs{cs_new:Npn} \cs{int_eval:n} |#1| \\
+%     ~~|{ \int_value:w \__int_eval:w #1 \__int_eval_end: }|
+%   \end{quote}
+%   would replace |#1| by |(#1)| in the definition of \cs{int_eval:n} when
+%   debugging is enabled.  This fails if the \meta{code} contains~|##|.
+%   The \cs{__kernel_patch_conditional_args:nNNpnn} function is for use
+%   before \cs{prg_new_conditional:Npnn} or its \texttt{_protected}
+%   counterpart.
+% \end{function}
+%
+% \begin{function}
+%   {\__kernel_patch_args:nnnNNpn, \__kernel_patch_conditional_args:nnnNNpnn}
+%   \begin{syntax}
+%     \cs{__kernel_patch_args:nnnNNpn} \Arg{before} \Arg{after} \Arg{arguments}
+%     \meta{definition} \meta{function} \meta{parameters} \Arg{code}
+%   \end{syntax}
+%   A combination of \cs{__kernel_patch:nnNNpn} and
+%   \cs{__kernel_patch_args:nNNpn}.
+% \end{function}
+%
+% \begin{function}{\__kernel_register_show:N, \__kernel_register_show:c}
+%   \begin{syntax}
+%     \cs{__kernel_register_show:N} \meta{register}
+%   \end{syntax}
+%   Used to show the contents of a \TeX{} register at the terminal, formatted
+%   such that internal parts of the mechanism are not visible.
+% \end{function}
+%
+% \begin{function}
+%   {\__kernel_register_log:N, \__kernel_register_log:c}
+%   \begin{syntax}
+%     \cs{__kernel_register_log:N} \meta{register}
+%   \end{syntax}
+%   Used to write the contents of a \TeX{} register to the log file in a
+%   form similar to \cs{__kernel_register_show:N}.
+% \end{function}
+%
+% \begin{function}[EXP]{\__kernel_str_to_other:n}
+%   \begin{syntax}
+%     \cs{__kernel_str_to_other:n} \Arg{token list}
+%   \end{syntax}
+%   Converts the \meta{token list} to a \meta{other string}, where
+%   spaces have category code \enquote{other}.  This function can be
+%   \texttt{f}-expanded without fear of losing a leading space, since
+%   spaces do not have category code $10$ in its result.  It takes a
+%   time quadratic in the character count of the string.
+% \end{function}
+%
+% \begin{function}[rEXP]{\__kernel_str_to_other_fast:n}
+%   \begin{syntax}
+%     \cs{__kernel_str_to_other_fast:n} \Arg{token list}
+%   \end{syntax}
+%   Same behaviour \cs{__kernel_str_to_other:n} but only restricted-expandable.
+%   It takes a time linear in the character count of the string.
+% \end{function}
+%
+% \end{implementation}
+%
+% \PrintIndex
diff --git a/l3kernel/l3msg.dtx b/l3kernel/l3msg.dtx
index 63912e8..e4b0cba 100644
--- a/l3kernel/l3msg.dtx
+++ b/l3kernel/l3msg.dtx
@@ -524,152 +524,6 @@
 %   documentation for the latter should be consulted for full details.
 % \end{function}
 %
-% \section{Kernel-specific functions}
-%
-% Messages from \LaTeX3 itself are handled by the general message system,
-% but have their own functions. This allows some text to be pre-defined,
-% and also ensures that serious errors can be handled properly.
-%
-% \begin{function}[added = 2017-12-17]
-%   {\__kernel_msg_new:nnnn, \__kernel_msg_new:nnn}
-%   \begin{syntax}
-%     \cs{__kernel_msg_new:nnnn} \Arg{module} \Arg{message} \Arg{text} \Arg{more text}
-%   \end{syntax}
-%   Creates a kernel \meta{message} for a given \meta{module}.
-%   The message is defined to first give \meta{text} and then
-%   \meta{more text} if the user requests it. If no \meta{more text} is
-%   available then a standard text is given instead. Within \meta{text}
-%   and \meta{more text} four parameters (|#1| to |#4|) can be used:
-%   these will be supplied and expanded at the time the message is used.
-%   An error is raised if the \meta{message} already exists.
-% \end{function}
-%
-% \begin{function}[added = 2017-12-17]
-%   {\__kernel_msg_set:nnnn, \__kernel_msg_set:nnn}
-%   \begin{syntax}
-%     \cs{__kernel_msg_set:nnnn} \Arg{module} \Arg{message} \Arg{text} \Arg{more text}
-%   \end{syntax}
-%   Sets up the text for a kernel \meta{message} for a given \meta{module}.
-%   The message is defined to first give \meta{text} and then
-%   \meta{more text} if the user requests it. If no \meta{more text} is
-%   available then a standard text is given instead. Within \meta{text}
-%   and \meta{more text} four parameters (|#1| to |#4|) can be used:
-%   these will be supplied and expanded at the time the message is used.
-% \end{function}
-%
-% \begin{function}[added = 2017-12-17]
-%   {
-%     \__kernel_msg_fatal:nnnnnn ,
-%     \__kernel_msg_fatal:nnnnn  ,
-%     \__kernel_msg_fatal:nnnn   ,
-%     \__kernel_msg_fatal:nnn    ,
-%     \__kernel_msg_fatal:nn     ,
-%     \__kernel_msg_fatal:nnxxxx ,
-%     \__kernel_msg_fatal:nnxxx  ,
-%     \__kernel_msg_fatal:nnxx   ,
-%     \__kernel_msg_fatal:nnx
-%   }
-%   \begin{syntax}
-%     \cs{__kernel_msg_fatal:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
-%   \end{syntax}
-%   Issues kernel \meta{module} error \meta{message}, passing \meta{arg one}
-%   to \meta{arg four} to the text-creating functions. After issuing a
-%   fatal error the \TeX{} run halts. Cannot be redirected.
-% \end{function}
-%
-% \begin{function}[added = 2017-12-17]
-%   {
-%     \__kernel_msg_error:nnnnnn ,
-%     \__kernel_msg_error:nnnnn  ,
-%     \__kernel_msg_error:nnnn   ,
-%     \__kernel_msg_error:nnn    ,
-%     \__kernel_msg_error:nn     ,
-%     \__kernel_msg_error:nnxxxx ,
-%     \__kernel_msg_error:nnxxx  ,
-%     \__kernel_msg_error:nnxx   ,
-%     \__kernel_msg_error:nnx
-%   }
-%   \begin{syntax}
-%     \cs{__kernel_msg_error:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
-%   \end{syntax}
-%   Issues kernel \meta{module} error \meta{message}, passing \meta{arg one}
-%   to
-%   \meta{arg four} to the text-creating functions. The error
-%   stops processing and issues the text at the terminal. After user input,
-%   the run continues. Cannot be redirected.
-% \end{function}
-%
-% \begin{function}[added = 2017-12-17]
-%   {
-%     \__kernel_msg_warning:nnnnnn ,
-%     \__kernel_msg_warning:nnnnn  ,
-%     \__kernel_msg_warning:nnnn   ,
-%     \__kernel_msg_warning:nnn    ,
-%     \__kernel_msg_warning:nn     ,
-%     \__kernel_msg_warning:nnxxxx ,
-%     \__kernel_msg_warning:nnxxx  ,
-%     \__kernel_msg_warning:nnxx   ,
-%     \__kernel_msg_warning:nnx
-%   }
-%   \begin{syntax}
-%     \cs{__kernel_msg_warning:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
-%   \end{syntax}
-%   Issues kernel \meta{module} warning \meta{message}, passing
-%   \meta{arg one} to
-%   \meta{arg four} to the text-creating functions. The warning text
-%   is added to the log file, but the \TeX{} run is not interrupted.
-% \end{function}
-%
-% \begin{function}[added = 2017-12-17]
-%   {
-%     \__kernel_msg_info:nnnnnn ,
-%     \__kernel_msg_info:nnnnn  ,
-%     \__kernel_msg_info:nnnn   ,
-%     \__kernel_msg_info:nnn    ,
-%     \__kernel_msg_info:nn     ,
-%     \__kernel_msg_info:nnxxxx ,
-%     \__kernel_msg_info:nnxxx  ,
-%     \__kernel_msg_info:nnxx   ,
-%     \__kernel_msg_info:nnx
-%   }
-%   \begin{syntax}
-%     \cs{__kernel_msg_info:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
-%   \end{syntax}
-%   Issues kernel \meta{module} information \meta{message}, passing
-%   \meta{arg one} to \meta{arg four} to the text-creating functions.
-%   The information text is added to the log file.
-% \end{function}
-%
-% \section{Expandable errors}
-%
-% In a few places, the \LaTeX3 kernel needs to produce errors in an
-% expansion only context. This must be handled internally very
-% differently from normal error messages, as none of the tools
-% to print to the terminal or the log file are expandable.
-% However, the interface is similar, with the important caveat that the
-% message text and arguments are not expanded, and messages should be
-% very short.
-%
-% \begin{function}[EXP, added = 2017-12-17]
-%   {
-%     \__kernel_msg_expandable_error:nnnnnn,
-%     \__kernel_msg_expandable_error:nnnnn,
-%     \__kernel_msg_expandable_error:nnnn,
-%     \__kernel_msg_expandable_error:nnn,
-%     \__kernel_msg_expandable_error:nn,
-%     \__kernel_msg_expandable_error:nnffff,
-%     \__kernel_msg_expandable_error:nnfff,
-%     \__kernel_msg_expandable_error:nnff,
-%     \__kernel_msg_expandable_error:nnf,
-%   }
-%   \begin{syntax}
-%     \cs{__kernel_msg_expandable_error:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
-%   \end{syntax}
-%   Issues an error, passing \meta{arg one} to \meta{arg four}
-%   to the text-creating functions. The resulting string must
-%   be much shorter than a line, otherwise it is cropped.
-% \end{function}
-%
 % \end{documentation}
 %
 % \begin{implementation}
diff --git a/l3kernel/l3str.dtx b/l3kernel/l3str.dtx
index 21e183c..b39d443 100644
--- a/l3kernel/l3str.dtx
+++ b/l3kernel/l3str.dtx
@@ -799,27 +799,6 @@
 %   code and so should only be used for short-term storage.
 % \end{variable}
 %
-% \section{Internal string functions}
-%
-% \begin{function}[EXP]{\__kernel_str_to_other:n}
-%   \begin{syntax}
-%     \cs{__kernel_str_to_other:n} \Arg{token list}
-%   \end{syntax}
-%   Converts the \meta{token list} to a \meta{other string}, where
-%   spaces have category code \enquote{other}.  This function can be
-%   \texttt{f}-expanded without fear of losing a leading space, since
-%   spaces do not have category code $10$ in its result.  It takes a
-%   time quadratic in the character count of the string.
-% \end{function}
-%
-% \begin{function}[rEXP]{\__kernel_str_to_other_fast:n}
-%   \begin{syntax}
-%     \cs{__kernel_str_to_other_fast:n} \Arg{token list}
-%   \end{syntax}
-%   Same behaviour \cs{__kernel_str_to_other:n} but only restricted-expandable.
-%   It takes a time linear in the character count of the string.
-% \end{function}
-%
 % \end{documentation}
 %
 % \begin{implementation}
diff --git a/l3kernel/l3token.dtx b/l3kernel/l3token.dtx
index 52f9283..c91363b 100644
--- a/l3kernel/l3token.dtx
+++ b/l3kernel/l3token.dtx
@@ -1094,20 +1094,6 @@
 % single tokens \enquote{N-type}, as they are suitable to be used as an
 % argument for a function with the signature~\texttt{:N}.
 %
-% \section{Internal functions}
-%
-% \begin{function}[EXP]{\__kernel_char_generate:nn}
-%   \begin{syntax}
-%      \cs{__kernel_char_generate:nn} \Arg{charcode} \Arg{catcode}
-%   \end{syntax}
-%   This function is identical in operation to the public
-%   \cs{char_generate:nn} but omits various sanity tests. In particular, this
-%   means it is used in certain places where engine variations need to be
-%   accounted for by the kernel.  The \meta{catcode} must give an explicit
-%   integer when expanded (and must not absorb a space for instance, nor
-%   be an integer variable).
-% \end{function}
-%
 % \end{documentation}
 %
 % \begin{implementation}
diff --git a/l3kernel/source3body.tex b/l3kernel/source3body.tex
index 9515ec3..b423691 100644
--- a/l3kernel/source3body.tex
+++ b/l3kernel/source3body.tex
@@ -402,6 +402,9 @@ used on top of \LaTeXe{} if \cs{outer} tokens are used in the arguments.
 
 \DocInput{l3bootstrap.dtx}
 \DocInput{l3names.dtx}
+\ExplSyntaxOn
+\clist_gput_right:Nn \g_docinput_clist { l3kernel-functions.dtx }
+\ExplSyntaxOff
 \DocInput{l3basics.dtx}
 \DocInput{l3expan.dtx}
 \DocInput{l3tl.dtx}





More information about the latex3-commits mailing list