From cd3bef34bd0bfcf1625056fd2f2832328c516179 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sat, 2 Jul 2022 03:03:53 +0000
Subject: CTAN sync 202207020303

---
 macros/latex/contrib/l3kernel/l3tl.dtx | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

(limited to 'macros/latex/contrib/l3kernel/l3tl.dtx')

diff --git a/macros/latex/contrib/l3kernel/l3tl.dtx b/macros/latex/contrib/l3kernel/l3tl.dtx
index d85b6b2a46..86c5ecb14c 100644
--- a/macros/latex/contrib/l3kernel/l3tl.dtx
+++ b/macros/latex/contrib/l3kernel/l3tl.dtx
@@ -43,7 +43,7 @@
 %    }^^A
 % }
 %
-% \date{Released 2022-06-16}
+% \date{Released 2022-07-01}
 %
 % \maketitle
 %
@@ -927,6 +927,26 @@
 %   \end{texnote}
 % \end{function}
 %
+% If you wish to handle token lists where the first token may be a space, and
+% this needs to be treated as the head/tail, this can be accomplished using
+% \cs{tl_if_head_is_space:nTF}, for example
+% \begin{verbatim}
+%   \exp_last_unbraced:NNo
+%     \cs_new:Npn \__mypkg_gobble_space:w \c_space_tl { }
+%   \cs_new:Npn \mypkg_tl_head_keep_space:n #1
+%     {
+%       \tl_if_head_is_space:nTF {#1}
+%         { ~ }
+%         { \tl_head:n {#1} }
+%     }
+%   \cs_new:Npn \mypkg_tl_tail_keep_space:n #1
+%     {
+%       \tl_if_head_is_space:nTF {#1}
+%         { \exp_not:o { \__mypkg_gobble_space:w #1 } }
+%         { \tl_tail:n {#1} }
+%     }
+% \end{verbatim}
+%
 % \subsection{Items and ranges in token lists}
 %
 % \begin{function}[added = 2014-07-17, EXP]
@@ -3577,7 +3597,7 @@
     \__kernel_chk_defined:NT #2
       {
         \exp_args:Nf \tl_if_empty:nTF
-          { \cs_prefix_spec:N #2 \cs_argument_spec:N #2 }
+          { \cs_prefix_spec:N #2 \cs_parameter_spec:N #2 }
           {
             \exp_args:Ne #1
               { \token_to_str:N #2 = \__kernel_exp_not:w \exp_after:wN {#2} }
@@ -3651,7 +3671,7 @@
     \__kernel_chk_defined:NT #1
       {
         \exp_args:Nf \tl_if_empty:nTF
-          { \cs_prefix_spec:N #1 \cs_argument_spec:N #1 }
+          { \cs_prefix_spec:N #1 \cs_parameter_spec:N #1 }
           {
             \tl_set:Nx \l_@@_internal_a_tl {#3}
             \tl_if_eq:NNTF #1 \l_@@_internal_a_tl
-- 
cgit v1.2.3

