diff --git a/base/changes.txt b/base/changes.txt index ccf925d0f1..4907f58c6a 100644 --- a/base/changes.txt +++ b/base/changes.txt @@ -6,6 +6,17 @@ to completeness or accuracy and it contains some references to files that are not part of the distribution. ================================================================================ +2026-03-13 Joseph Wright + * doc.dtx, ltcmd.dtx, ltcmdhooks.dtx, lthooks.dtx, ltkeys.dtx: + Remove variants now available in expl3 core + * ltexpl.dtx: Add check for sufficiently-recent expl3 + +2026-03-12 Joseph Wright + * doc.dtx, latexrelease.dtx, ltcmd.dtx, ltcmdhooks.dtx, ltfilehook.dtx, + ltfinal.dtx, ltfssdcl.dtx, lthooks.dtx, ltkeys.dtx, ltmarks.dtx, + ltpara.dtx, ltproperties.dtx, ltshipout.dtx, ltsockets.dtx, + source2edoc.cls: Switch from x- to e-type expansion in expl3 code + 2026-03-10 Joseph Wright * latexrelease.dtx: Use \msg_set:nnnn not \msg_gset:nnnn in rollback diff --git a/base/doc.dtx b/base/doc.dtx index 6c532b45d0..e9188c34cf 100644 --- a/base/doc.dtx +++ b/base/doc.dtx @@ -45,7 +45,7 @@ %<+package> %<+package>\ProvidesPackage{doc} %<+shortvrb>\ProvidesPackage{shortvrb} -%<+package|shortvrb> [2024/12/25 v3.0q +%<+package|shortvrb> [2026-03-13 v3.0r %<+package|shortvrb> Standard LaTeX documentation package V3 (FMi)] %\catcode`\<=12 % @@ -84,6 +84,8 @@ % \changes{v1.0p}{1994/05/21}{Use new error commands} % \changes{v3.0m}{2022/11/13}{Redefinitions of \cs{verb} removed as % no longer needed (gh/953)} +% \changes{v3.0r}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % % % \hyphenation{make-index} @@ -3342,11 +3344,11 @@ % ^^A -------------------------------------------------- % % -% \begin{macro}{\__doc_trace:x} +% \begin{macro}{\__doc_trace:e} % A helper for tracing\ldots % \begin{macrocode} -\cs_new:Npn\__doc_trace:x { - \legacy_if:nTF{ doc@debugshow }{ \iow_term:x } { \use_none:n } +\cs_new:Npn\__doc_trace:e { + \legacy_if:nTF{ doc@debugshow }{ \iow_term:e } { \use_none:n } } % \end{macrocode} % \end{macro} @@ -3377,7 +3379,7 @@ % \end{macrocode} % % \begin{macrocode} - \__doc_trace:x{Disable~ indexing~ for~ '\tl_to_str:n{#1}' } + \__doc_trace:e{Disable~ indexing~ for~ '\tl_to_str:n{#1}' } % \end{macrocode} % Adding the commands to the |\l__doc_donotindex_seq| sequence is % done by mapping the function |\__doc_dont_index_aux:n| on each @@ -3393,7 +3395,7 @@ % at all), % \begin{macrocode} \cs_new:Npn \__doc_dont_index_aux:n #1 { - \seq_put_right:Nx \l__doc_donotindex_seq {\expandafter\@gobble \string#1} + \seq_put_right:Ne \l__doc_donotindex_seq {\expandafter\@gobble \string#1} } % \end{macrocode} % \end{macro} @@ -3412,7 +3414,7 @@ % Some tracing information that may be helpful. % \begin{macrocode} \def \ShowIndexingState { - \__doc_trace:x{Show~ doc~ indexing~ state:} + \__doc_trace:e{Show~ doc~ indexing~ state:} \seq_show:N \l__doc_donotindex_seq \prop_show:N \g__doc_idxtype_prop } @@ -3433,7 +3435,7 @@ % is then done by |\__doc_idxtype_put:nn| % \begin{macrocode} \cs_new:Npn \__doc_idxtype_put:Nn #1#2 { - \exp_args:Nx \__doc_idxtype_put:nn { \cs_to_str:N #1 }{#2} + \exp_args:Ne \__doc_idxtype_put:nn { \cs_to_str:N #1 }{#2} % \end{macrocode} % We also make an entry in the \texttt{.aux} file so that this % declaration becomes immediately available in the next @@ -3452,7 +3454,7 @@ % cumulate over time. % \begin{macrocode} \cs_new:Npn \RecordIndexTypeAux #1#2 { - \exp_args:Nx \__doc_idxtype_put:nn { \cs_to_str:N #1 }{#2} + \exp_args:Ne \__doc_idxtype_put:nn { \cs_to_str:N #1 }{#2} } % \end{macrocode} % Similarly, when the \texttt{.aux} is read at the end of the run we @@ -3536,10 +3538,10 @@ % Some tracing info \ldots{} % \begin{macrocode} { - \__doc_trace:x{Not~ recording~ index~ type~ for~ '\bslash #1' } + \__doc_trace:e{Not~ recording~ index~ type~ for~ '\bslash #1' } } { - \__doc_trace:x{Recording~ index~ type~ for~ '\bslash #1' ~ as~ #2 } + \__doc_trace:e{Recording~ index~ type~ for~ '\bslash #1' ~ as~ #2 } % \end{macrocode} % Stick the data into the property list: % \begin{macrocode} @@ -3561,15 +3563,7 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\tl_to_str:o} -% Another helper: take some token list variable, expand it and turn -% it into a string. -% \begin{macrocode} -\cs_generate_variant:Nn \tl_to_str:n {o} -% \end{macrocode} -% \end{macro} -% -% +% \changes{v3.0r}{2026-03-13}{Tidy up variants} % % ^^A -------------------------------------------------- % @@ -3632,7 +3626,7 @@ % \end{macrocode} % A bit of tracing: % \begin{macrocode} - \__doc_trace:x{Searching~ for~ '\bslash #1'} + \__doc_trace:e{Searching~ for~ '\bslash #1'} % \end{macrocode} % If the name is on the exclude list do nothing. % \begin{macrocode} @@ -3641,7 +3635,7 @@ % % \begin{macrocode} { - \__doc_trace:x{Not~ indexing~ '\bslash #1' } + \__doc_trace:e{Not~ indexing~ '\bslash #1' } } % \end{macrocode} % Otherwise check if this name has an index type property attached @@ -3666,7 +3660,7 @@ % deals with some special cases for single letter macros. % \begin{macrocode} { - \__doc_trace:x{Indexing~ '\bslash #1'\space (\string #2)} + \__doc_trace:e{Indexing~ '\bslash #1'\space (\string #2)} \exp_args:No #2 {\bslash #1} } } @@ -3759,7 +3753,7 @@ % \begin{macrocode} \cs_if_exist:NTF #1 { - \__doc_trace:x{Indexing~ '#3'\space as~ + \__doc_trace:e{Indexing~ '#3'\space as~ \tl_use:N \l__doc_idxtype_tl } #1{#2}{#3} } diff --git a/base/doc/ltnews43.tex b/base/doc/ltnews43.tex index 9a29a8d934..d6a39f440c 100644 --- a/base/doc/ltnews43.tex +++ b/base/doc/ltnews43.tex @@ -304,6 +304,15 @@ \subsection{Removal of \enquote{fake math} from the kernel} offset to a predictable offset based on text font dimensions (for example a fixed percentage of the x-height). +\section{Formalization of L3PL (\pkg{expl3}) release requirement} + +In this release, we have formalized which release of the L3 Programming Layer +(\pkg{expl3}) is required by the kernel: at least the 2023-11-27 release. This +has allowed us to tidy up some places where the kernel uses L3PL, in particular +where we have made improvements in the L3PL and want these to be used by the +kernel. If the version of the L3PL available is too old, an error will be +issued and format building will be abandoned. + \section{New or improved documentation} Adding new features to \LaTeX{} means writing new documentation. To date, each @@ -352,7 +361,6 @@ \subsection{Improved copy\,\&\,paste for \pdfTeX{} and \LuaTeX{} documents} % \githubissue{2007} - \section{Bug fixes} \subsection{Improve transparency of \cs{label}, \cs{index}, and friends} diff --git a/base/latexrelease.dtx b/base/latexrelease.dtx index a27028e531..591e799f1e 100644 --- a/base/latexrelease.dtx +++ b/base/latexrelease.dtx @@ -40,7 +40,7 @@ %<*latexrelease> % \fi % \ProvidesFile{latexrelease.dtx} - [2026/03/10 v1.0r LaTeX release emulation and tests + [2026-03-13 v1.0s LaTeX release emulation and tests (including releases up to \latexreleaseversion)] % \iffalse % @@ -482,6 +482,9 @@ \NeedsTeXFormat{LaTeX2e}[1996/06/01] % \end{macrocode} % +% \changes{v1.0s}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} +% % \subsection{Setup} % % \begin{macro}{\sourceLaTeXdate} @@ -714,7 +717,7 @@ of this package available from CTAN} % checks if the new register is really necessary. This code does % not clear the register, which might cause problems in the future, % if a register is allocated but not properly cleared before using; -% \item[__kernel_msg_error:nnx] This command is used to error on +% \item[__kernel_msg_error:nne] This command is used to error on % already defined scan marks. Just making the error do nothing is % enough, as no action is taken in that case; % \item[msg_new:nnnn] Used to define new messages. Making it @@ -730,18 +733,16 @@ of this package available from CTAN} % And here we go: % \changes{v1.0r}{2026/03/10} % {Use \cs{msg_set:nnnn} instead of \cs{msg_gset:nnnn} in rollback} +% \changes{v1.0s}{2026-03-13}{Remove \cs{__kernel_msg_error:nnn} from +% definitions, as it's not used in the kernel anymore} % \begin{macrocode} \@@_redefines:w \__kernel_chk_if_free_cs:N \use_none:n \e@alloc \@@_e@alloc:NnnnnN - \__kernel_msg_error:nnx \use_none:nnn + \__kernel_msg_error:nne \use_none:nnn \msg_new:nnnn \msg_set:nnnn % \NewDocumentCommand \DeclareDocumentCommand % after ltcmd.dtx \newcommand \@@_declare_command:w -% \end{macrocode} -% Temp addition \ldots -% \begin{macrocode} - \__kernel_msg_error:nnn \use_none:nnn % needed while redirect for kernel msgs doesn't work \q_recursion_tail \q_recursion_tail \q_recursion_stop % \end{macrocode} diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx index 947993ffe6..3ecb53727c 100644 --- a/base/ltcmd.dtx +++ b/base/ltcmd.dtx @@ -34,8 +34,8 @@ %%% From File: ltcmd.dtx % % \begin{macrocode} -\def\ltcmdversion{v1.3j} -\def\ltcmddate{2026-02-25} +\def\ltcmdversion{v1.3k} +\def\ltcmddate{2026-03-13} % \end{macrocode} % %<*driver> @@ -1015,6 +1015,8 @@ % % \changes{v1.0b}{2021/03/18}{Use \cs{NewModuleRelease}.} % \changes{v1.0e}{2021/05/24}{Use \cs{msg_...} instead of \cs{__kernel_msg...}} +% \changes{v1.3k}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % % \pkg{ltcmd} code contains an |^^@| character, which usually has % catcode~15, so \cs{IncludeInRelease} will break when this code is @@ -1352,7 +1354,7 @@ { \cs_if_exist:NTF #1 { - \msg_info:nnxx { cmd } { redefine } + \msg_info:nnee { cmd } { redefine } { \token_to_str:N #1 } { \tl_to_str:n {#2} } } { @@ -1360,10 +1362,10 @@ { \cs_if_exist_p:c { \cs_to_str:N #1 ~ code } } { \cs_if_exist_p:c { \cs_to_str:N #1 ~ defaults } } { - \msg_warning:nnx { cmd } { unsupported-let } + \msg_warning:nne { cmd } { unsupported-let } { \token_to_str:N #1 } } - \msg_info:nnxx { cmd } { define-command } + \msg_info:nnee { cmd } { define-command } { \token_to_str:N #1 } { \tl_to_str:n {#2} } } \bool_set_false:N \l_@@_environment_bool @@ -1377,7 +1379,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_declare_cmd_internal:Nnnn #1#2#3#4 { - \tl_set:Nx \l_@@_function_tl { \cs_to_str:N #1 } + \tl_set:Ne \l_@@_function_tl { \cs_to_str:N #1 } \@@_normalize_arg_spec:n {#2} \exp_args:No \@@_prepare_signature:n \l_@@_arg_spec_tl \@@_declare_cmd_code:Nnn #1 {#2} {#3} @@ -1441,7 +1443,7 @@ { ! \tl_if_blank_p:e { \@@_all_m_check:n {#2} } } } { - \tl_set:Nx \l_@@_fn_tl + \tl_set:Ne \l_@@_fn_tl { \exp_not:c { \l_@@_function_tl \c_space_tl } } \bool_if:NTF \l_@@_grab_expandably_bool { \@@_declare_cmd_code_expandable:Nnn } @@ -1494,7 +1496,7 @@ \cs_generate_from_arg_count:cNnn { \l_@@_function_tl \c_space_tl code } \cs_set_protected:Npn \l_@@_current_arg_int {#3} - \cs_set_protected_nopar:Npx #1 + \cs_set_protected_nopar:Npe #1 { \bool_if:NTF \l_@@_environment_bool { @@ -1540,7 +1542,7 @@ \l_@@_current_arg_int {#3} \bool_if:NT \l_@@_defaults_bool { - \use:x + \use:e { \cs_generate_from_arg_count:cNnn { \l_@@_function_tl \c_space_tl defaults } @@ -1549,7 +1551,7 @@ } } \bool_if:NTF \l_@@_expandable_bool - { \cs_set_nopar:Npx } { \cs_set_protected_nopar:Npx } #1 + { \cs_set_nopar:Npe } { \cs_set_protected_nopar:Npe } #1 { \exp_not:N \@@_start_expandable:nNNNNn { \exp_not:n {#2} } @@ -1570,12 +1572,12 @@ { \bool_if:NT \l_@@_some_short_bool { - \cs_set_nopar:cpx { \l_@@_function_tl \c_space_tl \c_space_tl } + \cs_set_nopar:cpe { \l_@@_function_tl \c_space_tl \c_space_tl } ##1##2 { ##1 {##2} } } - \cs_set:cpx + \cs_set:cpe } - { \cs_set_nopar:cpx } + { \cs_set_nopar:cpe } { \l_@@_function_tl \c_space_tl } ##1##2 { ##1 {##2} } } % \end{macrocode} @@ -1648,7 +1650,7 @@ \exp_args:Nc \@@_declare_cmd_internal:Nnnn { environment~ #1 } {#2} {#3} { - \cs_set_nopar:cpx { environment~ #1 ~end } + \cs_set_nopar:cpe { environment~ #1 ~end } { \exp_not:c { environment~ #1 ~end~aux } } \cs_generate_from_arg_count:cNnn { environment~ #1 ~end~aux~ } \cs_set:Npn @@ -1659,7 +1661,7 @@ } \cs_new_protected:Npn \@@_set_environment_end:n #1 { - \cs_set_nopar:cpx { environment~ #1 ~end~aux } + \cs_set_nopar:cpe { environment~ #1 ~end~aux } { \exp_not:c { environment~ #1 ~end~aux~ } \exp_not:o \l_@@_args_tl @@ -1696,7 +1698,7 @@ { environment~ \l_@@_environment_str \c_space_tl code } {#1} } -\cs_new_protected:Npx \@@_start:nNNnnn #1#2#3 +\cs_new_protected:Npe \@@_start:nNNnnn #1#2#3 { \exp_not:c { xparse~function~is~not~expandable } \exp_not:N \conditionally@traceoff @@ -1774,7 +1776,7 @@ } \cs_new_protected:Npn \@@_defaults_aux: { - \tl_set:Nx \l_@@_args_ii_tl + \tl_set:Ne \l_@@_args_ii_tl { \exp_after:wN \@@_tmp:w \l_@@_args_i_tl } \tl_if_eq:NNT \l_@@_args_ii_tl \l_@@_args_i_tl { \use_none_delimit_by_q_recursion_stop:w } @@ -1782,13 +1784,14 @@ } \cs_new_protected:Npn \@@_defaults_error:w \q_recursion_stop { - \msg_error:nnx { cmd } { default-loop } + \msg_error:nne { cmd } { default-loop } { \@@_environment_or_command: } } % \end{macrocode} % % \changes{v1.1e}{2023/05/26} % {Use simpler variant \cs{cs_generate_from_arg_count:NNno}} +% \changes{v1.3k}{2026-03-13}{Tidy up variants} % To construct \cs{@@_tmp:w}, first go through the arguments % found and the corresponding defaults, building a token list with % |{#|\meta{arg number}|}| for arguments found in the input (whose @@ -1805,7 +1808,6 @@ \cs_generate_from_arg_count:NNno \@@_tmp:w \cs_set:Npn \l_@@_current_arg_int \l_@@_tmpa_tl } -\cs_generate_variant:Nn \cs_generate_from_arg_count:NNnn { NNno } \cs_new_protected:Npn \@@_defaults_def:nn { \int_incr:N \l_@@_current_arg_int @@ -1813,7 +1815,7 @@ } \cs_new_protected:Npn \@@_defaults_def:nnn #1#2#3 { - \tl_put_right:Nx \l_@@_tmpa_tl + \tl_put_right:Ne \l_@@_tmpa_tl { { \exp_not:N \exp_not:n @@ -2014,7 +2016,7 @@ \q_recursion_tail \q_recursion_tail \q_recursion_tail \q_recursion_stop \int_compare:nNnT \l_@@_current_arg_int > 9 { - \msg_error:nnxx { cmd } { too-many-args } + \msg_error:nnee { cmd } { too-many-args } { \@@_environment_or_command: } { \tl_to_str:n {#1} } \@@_bad_def:wn } @@ -2022,7 +2024,7 @@ { \tl_if_empty:NF \l_@@_last_delimiters_tl { - \msg_error:nnxx { cmd } { expandable-ending-optional } + \msg_error:nnee { cmd } { expandable-ending-optional } { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} } \@@_bad_def:wn } @@ -2046,11 +2048,11 @@ { \str_if_eq_p:nn {#1} { u } } } { - \msg_error:nnxx { cmd } { xparse-arg-type } + \msg_error:nnee { cmd } { xparse-arg-type } { \@@_environment_or_command: } { \tl_to_str:n {#1} } } { - \msg_error:nnxx { cmd } { unknown-argument-type } + \msg_error:nnee { cmd } { unknown-argument-type } { \@@_environment_or_command: } { \tl_to_str:n {#1} } } \@@_bad_def:wn @@ -2121,11 +2123,11 @@ \quark_if_recursion_tail_stop_do:nn {#2} { \@@_bad_arg_spec:wn } \bool_if:NT \l_@@_expandable_bool { - \msg_error:nnxx { cmd } { processor-in-expandable } + \msg_error:nnee { cmd } { processor-in-expandable } { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} } \@@_bad_def:wn } - \tl_put_right:Nx \l_@@_arg_spec_tl { > { \tl_trim_spaces:n {#1} } } + \tl_put_right:Ne \l_@@_arg_spec_tl { > { \tl_trim_spaces:n {#1} } } \int_decr:N \l_@@_current_arg_int \bool_set_false:N \l_@@_grab_expandably_bool \@@_normalize_arg_spec_loop:n {#2} @@ -2152,13 +2154,13 @@ { \bool_if:NT \l_@@_expandable_bool { - \msg_error:nnxx { cmd } { keyval-in-expandable } + \msg_error:nnee { cmd } { keyval-in-expandable } { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} } \@@_bad_def:wn } \bool_set_true:N \l_@@_suppress_strip_bool \bool_set_false:N \l_@@_grab_expandably_bool - \tl_put_right:Nx \l_@@_arg_spec_tl + \tl_put_right:Ne \l_@@_arg_spec_tl { = { \tl_trim_spaces:n {#1} } } } } @@ -2167,7 +2169,7 @@ \quark_if_recursion_tail_stop_do:nn {#2} { \@@_bad_arg_spec:wn } \bool_if:NT #3 { - \msg_error:nnxx { cmd } { two-markers } + \msg_error:nnee { cmd } { two-markers } { \@@_environment_or_command: } { #1 } \@@_bad_def:wn } @@ -2235,7 +2237,7 @@ { \quark_if_recursion_tail_stop_do:Nn #1 { \@@_bad_arg_spec:wn } \@@_single_token_check:n {#1} \@@_allowed_token_check:N #1 - \tl_put_right:Nx \l_@@_arg_spec_tl + \tl_put_right:Ne \l_@@_arg_spec_tl { \bool_if:NT \l_@@_obey_spaces_bool { ! } t \exp_not:n {#1} @@ -2308,14 +2310,14 @@ { \bool_if:NF \l_@@_environment_bool { - \msg_error:nnxx { cmd } { invalid-command-arg } + \msg_error:nnee { cmd } { invalid-command-arg } { \@@_environment_or_command: } {#2} \@@_bad_def:wn } \tl_clear:N \l_@@_last_delimiters_tl \@@_add_arg_spec:n {#2} \quark_if_recursion_tail_stop:n {#1} - \msg_error:nnxxx { cmd } { arg-after-body } + \msg_error:nneee { cmd } { arg-after-body } {#2} { \@@_environment_or_command: } { \tl_to_str:n {#1} } @@ -2334,7 +2336,7 @@ { \tl_trim_spaces_apply:nN {#1} \tl_if_single_token:nF { - \msg_error:nnxx { cmd } { not-single-token } + \msg_error:nnee { cmd } { not-single-token } { \@@_environment_or_command: } { \tl_to_str:n {#1} } \@@_bad_def:wn } @@ -2366,7 +2368,7 @@ { \use_none:n } } { - \msg_error:nnxxx { cmd } { forbidden-group-token } + \msg_error:nneee { cmd } { forbidden-group-token } { \@@_environment_or_command: } { \tl_to_str:n {#1} } { \token_if_eq_meaning:NNTF #1 \c_group_begin_token @@ -2386,7 +2388,7 @@ { \bool_if:NT \l_@@_expandable_bool { - \msg_error:nnxx { cmd } { invalid-expandable-arg } + \msg_error:nnee { cmd } { invalid-expandable-arg } { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} } \@@_bad_def:wn } @@ -2398,7 +2400,7 @@ { \tl_if_empty:NF \l_@@_last_delimiters_tl { - \msg_error:nnxx { cmd } { invalid-after-optional-expandably } + \msg_error:nnee { cmd } { invalid-after-optional-expandably } { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} } \@@_bad_def:wn } @@ -2419,7 +2421,7 @@ { \tl_if_eq:nnT {##1} {#1} { - \msg_warning:nnxx { cmd } { optional-mandatory } + \msg_warning:nnee { cmd } { optional-mandatory } {#2} {#3} } } @@ -2433,7 +2435,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_bad_arg_spec:wn #1 \@@_break_point:n #2 { - \msg_error:nnxx { cmd } { bad-arg-spec } + \msg_error:nnee { cmd } { bad-arg-spec } { \@@_environment_or_command: } { \tl_to_str:n {#2} } } \cs_new_protected:Npn \@@_bad_def:wn #1 \@@_break_point:n #2 { } @@ -2465,7 +2467,7 @@ { \bool_if:NT \l_@@_expandable_bool { - \msg_error:nnx { cmd } { long-short-mix } + \msg_error:nne { cmd } { long-short-mix } { \iow_char:N \\ \l_@@_function_tl } \@@_bad_def:wn } @@ -2474,7 +2476,7 @@ \bool_if:NTF \l_@@_long_bool { \bool_set_true:N \l_@@_some_long_bool } { \bool_set_true:N \l_@@_some_short_bool } - \tl_put_right:Nx \l_@@_arg_spec_tl + \tl_put_right:Ne \l_@@_arg_spec_tl { \bool_lazy_and:nnT { \l_@@_long_bool } @@ -2490,7 +2492,7 @@ { \bool_if:NT \l_@@_some_obey_spaces_bool { - \msg_error:nnxx { cmd } { invalid-bang } + \msg_error:nnee { cmd } { invalid-bang } { \@@_environment_or_command: } { \bool_if:NTF \l_@@_obey_spaces_bool @@ -2698,7 +2700,7 @@ { \@@_flush_m_args: \@@_add_default_E:nn {#1} {#2} - \use:x + \use:e { \@@_replicate_processor:nn { \tl_count:n {#1} } { \exp_not:o \l_@@_process_one_tl } @@ -2743,7 +2745,7 @@ \cs_new_protected:Npn \@@_replicate_processor:nn #1 #2 { \int_compare:nNnF {#1} > { 1 } { \use_none:nnn } - \tl_set:Nx \l_@@_process_one_tl + \tl_set:Ne \l_@@_process_one_tl { \exp_not:n { \exp_not:n {#2} \if_false: { \fi: } } \prg_replicate:nn { #1 - 2 } @@ -2828,9 +2830,9 @@ { \int_compare:nNnT \l_@@_m_args_int > 0 { - \tl_put_right:Nx \l_@@_signature_tl + \tl_put_right:Ne \l_@@_signature_tl { \exp_not:c { @@_grab_m_ \int_use:N \l_@@_m_args_int :w } } - \tl_put_right:Nx \l_@@_process_all_tl + \tl_put_right:Ne \l_@@_process_all_tl { \prg_replicate:nn { \l_@@_m_args_int } { { } } } } \int_zero:N \l_@@_m_args_int @@ -2853,7 +2855,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_add_grabber:N #1 { - \tl_put_right:Nx \l_@@_signature_tl + \tl_put_right:Ne \l_@@_signature_tl { \exp_not:c { @@ -2881,7 +2883,7 @@ \bool_set_false:N \l_@@_obey_spaces_bool \bool_set_false:N \l_@@_suppress_strip_bool \bool_set_false:N \l_@@_verb_safe_bool - \tl_put_right:Nx \l_@@_process_all_tl + \tl_put_right:Ne \l_@@_process_all_tl { { \if_charcode:w E #1 \use_i:nn \fi: @@ -2977,8 +2979,8 @@ \cs_new_protected:Npn \@@_add_expandable_type_D_aux:NNN #1#2#3 { \bool_if:NTF \l_@@_long_bool - { \cs_set:cpx } - { \cs_set_nopar:cpx } + { \cs_set:cpe } + { \cs_set_nopar:cpe } { \l_@@_expandable_aux_name_tl } ##1 ##2 #2 ##3 \q_@@ ##4 #3 { ##1 {##2} {##3} {##4} } \@@_add_expandable_grabber:nn {#1} @@ -2990,8 +2992,8 @@ \cs_new_protected:Npn \@@_add_expandable_type_D_aux:NN #1#2 { \bool_if:NTF \l_@@_long_bool - { \cs_set:cpx } - { \cs_set_nopar:cpx } + { \cs_set:cpe } + { \cs_set_nopar:cpe } { \l_@@_expandable_aux_name_tl } ##1 #2 ##2 #2 { ##1 {##2} } \@@_add_expandable_grabber:nn { #1_alt } @@ -3035,7 +3037,7 @@ \cs_new_protected:Npn \@@_add_expandable_type_E_aux:n #1 { \@@_get_grabber:NN #1 \l_@@_tmpa_tl - \tl_put_right:Nx \l_@@_tmpb_tl + \tl_put_right:Ne \l_@@_tmpb_tl { \exp_not:o \l_@@_tmpa_tl \exp_not:N #1 } } % \end{macrocode} @@ -3089,7 +3091,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_add_expandable_grabber:nn #1#2 { - \tl_put_right:Nx \l_@@_signature_tl + \tl_put_right:Ne \l_@@_signature_tl { \exp_not:c { @@_expandable_grab_ #1 :w } #2 } } % \end{macrocode} @@ -3168,7 +3170,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_copy:NN #1 #2 { - \use:x + \use:e { \int_set:Nn \tex_escapechar:D { 92 } \exp_not:N \@@_cmd_type_cases:NnnnnnF \exp_not:N #2 @@ -3238,7 +3240,7 @@ { \cs_set_eq:cc { #1 ~ code } { #2 ~ code } \@@_set_eq_if_exist:cc { #1 ~ defaults } { #2 ~ defaults } - \cs_set_protected_nopar:Npx #3 + \cs_set_protected_nopar:Npe #3 { \exp_after:wN \@@_copy_command:NnNNnnnn #4 {#1} } } \cs_new:Npn \@@_copy_command:NnNNnnnn #1 #2 #3 #4 #5 #6 #7 #8 @@ -3293,7 +3295,7 @@ \@@_set_eq_if_exist:cc { #1 ~ defaults } { #2 ~ defaults } \exp_after:wN \@@_copy_expandable_signature:NnNNNNnnn #4 {#1} {#2} \token_if_protected_macro:NTF #4 - { \cs_set_protected_nopar:Npx }{ \cs_set_nopar:Npx } + { \cs_set_protected_nopar:Npe }{ \cs_set_nopar:Npe } #3 { \exp_after:wN \@@_copy_expandable:NnNNNNnnn #4 {#1} {#2} } } @@ -3386,14 +3388,14 @@ \int_incr:N \l_@@_current_arg_int \exp_after:wN \@@_copy_parse_grabber:w \token_to_str:N #3 {#1} {#2} } -\use:x +\use:e { - \cs_new_protected:Npn \exp_not:N \@@_copy_parse_grabber:w ##1 - \tl_to_str:n { expandable_grab_ } ##2 \tl_to_str:n { :w } + \cs_new_protected:Npn \exp_not:N \@@_copy_parse_grabber:w #1 + \tl_to_str:n { expandable_grab_ } #2 \tl_to_str:n { :w } { - \tl_put_right:Nx \exp_not:N \l_@@_tmpa_tl - { \exp_not:N \exp_not:c { @@_expandable_grab_##2:w } } - \exp_not:N \cs_if_exist_use:cF { @@_copy_grabber_##2:w } + \tl_put_right:Ne \exp_not:N \l_@@_tmpa_tl + { \exp_not:N \exp_not:c { @@_expandable_grab_#2:w } } + \exp_not:N \cs_if_exist_use:cF { @@_copy_grabber_#2:w } { \@@_cant_copy:nwn { unknown-type } } } } @@ -3413,7 +3415,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_copy_grabber_D:w #1 #2 #3 #4 #5 { - \tl_put_right:Nx \l_@@_tmpa_tl + \tl_put_right:Ne \l_@@_tmpa_tl { \exp_not:c { #1 ~ (arg ~ \int_use:N \l_@@_current_arg_int ) } \exp_not:n { #4 #5 } @@ -3484,7 +3486,7 @@ \cs_set_eq:cc { environment~ #1 ~ code } { environment~ #2 ~ code } \@@_set_eq_if_exist:cc { environment~ #1 ~ defaults } { environment~ #2 ~ defaults } - \cs_set_protected_nopar:cpx { environment~ #1 } + \cs_set_protected_nopar:cpe { environment~ #1 } { \exp_after:wN \@@_copy_environment:Nnnnnnn #4 {#1} } \cs_set_eq:cc {#1} { environment~ #1 } } @@ -3512,7 +3514,7 @@ } \cs_new_protected:Npn \@@_copy_environment_end_aux:nnNN #1 #2 #3 #4 { - \cs_set_nopar:cpx { environment~ #1 ~end } + \cs_set_nopar:cpe { environment~ #1 ~end } { \exp_not:c { environment~ #1 ~end~aux } } \cs_set_eq:cc { environment~ #1 ~end~aux~ } { environment~ #2 ~end~aux~ } @@ -3527,7 +3529,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_check_end:Nn #1 #2 { - \tl_set:Nx #1 { \@@_check_end:n {#2} } + \tl_set:Ne #1 { \@@_check_end:n {#2} } \token_if_eq_meaning:NNT #1 \q_nil { \@@_cant_copy:nwn { invalid-end } } } @@ -3576,7 +3578,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_show:N #1 { - \use:x + \use:e { \int_set:Nn \tex_escapechar:D { 92 } \exp_not:N \@@_cmd_type_cases:NnnnnnF \exp_not:N #1 @@ -3602,7 +3604,7 @@ % \@@_show_optimized:N, % \@@_show_command_aux:NnNNn, % \@@_show_environment:N, -% \@@_show:x, +% \@@_show:e, % } % These commands just expand the command once to reveal its innards, % then pass the type of command, the control sequence, the signature, @@ -3612,7 +3614,7 @@ { \exp_after:wN \@@_show_command:NnNNwN #1 \q_@@ #1 } \cs_new_protected:Npn \@@_show_command:NnNNwN #1 #2 #3 #4 #5 \q_@@ #6 { - \@@_show_command_aux:NnNNn \tl_show:x + \@@_show_command_aux:NnNNn \tl_show:e { document~command } #6 #4 {#2} } \cs_new_protected:Npn \@@_show_expandable:N #1 @@ -3637,7 +3639,7 @@ % {Distinguish~non-expandable~document~commands} \cs_new_protected:Npn \@@_show_expandable:NnNNNNnN #1 #2 #3 #4 #5 #6 #7 #8 { - \exp_args:NNe \@@_show_command_aux:NnNNn \tl_show:x + \exp_args:NNe \@@_show_command_aux:NnNNn \tl_show:e { \token_if_protected_macro:NF #8 { expandable~ } document~command } #8 #5 {#2} } @@ -3719,7 +3721,6 @@ \cs_replacement_spec:N #1 } } -\cs_generate_variant:Nn \tl_count:n { e } % \end{macrocode} % % We can reuse most of the above to show an environment, except that @@ -3737,7 +3738,7 @@ \cs_new_protected:Npn \@@_show_environment:N #1 { \exp_after:wN \@@_show_environment:Nnnw #1 \q_@@ - \tl_show:x + \tl_show:e { \token_to_str:N \end { \cs_to_str:N #1 } : \iow_newline: -> \exp_args:Nc \cs_replacement_spec:N @@ -3746,9 +3747,9 @@ } \cs_new_protected:Npn \@@_show_environment:Nnnw #1 #2 #3 #4 \q_@@ { - \use:x + \use:e { - \@@_show_command_aux:NnNNn \@@_show:x { document~environment } + \@@_show_command_aux:NnNNn \@@_show:e { document~environment } { \exp_not:N \begin {#3} } \exp_not:c { environment~ #3 ~ code } {#2} @@ -3756,16 +3757,16 @@ } \cs_if_exist:NTF \iow_show:e { - \cs_new_protected:Npn \@@_show:x #1 + \cs_new_protected:Npn \@@_show:e #1 { \iow_show:e { > ~ #1 . \iow_newline: } } } { - \cs_new_protected:Npn \@@_show:x #1 - { \iow_term:x { > ~ #1 . \iow_newline: } } + \cs_new_protected:Npn \@@_show:e #1 + { \iow_term:e { > ~ #1 . \iow_newline: } } } \cs_new_protected:Npn \@@_show_environment_end:N #1 { - \exp_args:NNx \@@_check_end:Nn \l_@@_tmpa_tl { \cs_to_str:N #1 } + \exp_args:NNe \@@_check_end:Nn \l_@@_tmpa_tl { \cs_to_str:N #1 } \exp_args:Nc \@@_show_environment:N { \l_@@_tmpa_tl } } % \end{macrocode} @@ -3936,14 +3937,14 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_split_start_item: { - \tl_set:Nx \l_@@_tmpb_tl + \tl_set:Ne \l_@@_tmpb_tl { ~ \c_space_tl \c_hash_str \int_use:N \l_@@_current_arg_int : } } \cs_new_protected:Npn \@@_split_add_item:n #1 - { \tl_put_right:Nx \l_@@_tmpb_tl { \tl_to_str:n {#1} } } + { \tl_put_right:Ne \l_@@_tmpb_tl { \tl_to_str:n {#1} } } \cs_new_protected:Npn \@@_split_end_item:n #1 { - \tl_put_right:Nx \l_@@_tmpa_tl + \tl_put_right:Ne \l_@@_tmpa_tl { \l_@@_tmpb_tl \tl_to_str:n {#1} \iow_newline: } \tl_clear:N \l_@@_tmpb_tl \int_incr:N \l_@@_current_arg_int @@ -4022,7 +4023,7 @@ } \cs_new_protected:Npn \@@_grab_b_end:Nw #1#2 \@@_run_code: { - \tl_set:Nx \l_@@_args_tl + \tl_set:Ne \l_@@_args_tl { \exp_not:V \l_@@_saved_args_tl { \exp_after:wN #1 \l_@@_args_tl } @@ -4272,7 +4273,7 @@ } % \exp_args:NNNo \group_end: % \tl_set:Nn \l_@@_v_arg_tl { \l_@@_v_arg_tl } % - \@@_add_arg:x % + \@@_add_arg:e % { % \bool_if:NTF \l_@@_obey_spaces_bool % { \exp_not:V } % @@ -4486,7 +4487,7 @@ \q_nil ##2 \q_@@ \ERROR } { - \tl_put_right:Nx \l_@@_nesting_a_tl + \tl_put_right:Ne \l_@@_nesting_a_tl { \@@_grab_D_nested:w \q_nil ##2 \q_stop } \tl_if_in:NnTF \l_@@_nesting_b_tl {#1} { @@ -4610,7 +4611,7 @@ { \prop_get:NnNF \l_@@_tmp_prop {####1} \l_@@_tmpb_tl { \tl_set:Nn \l_@@_tmpb_tl { \NoValue } } - \tl_put_right:Nx \l_@@_args_tl + \tl_put_right:Ne \l_@@_args_tl { { \exp_not:V \l_@@_tmpb_tl } } } \l_@@_signature_tl \@@_run_code: @@ -4725,7 +4726,7 @@ \exp_after:wN \cs_set_eq:NN \l_@@_fn_tl \@@_grab_m_aux:Nnnnnnnnn \l_@@_fn_tl \prg_do_nothing: } -\cs_new_protected:cpx { @@_grab_m_9:w } +\cs_new_protected:cpe { @@_grab_m_9:w } { \exp_not:c { @@_grab_m_5:w } \exp_not:c { @@_grab_m_4:w } @@ -4760,7 +4761,7 @@ \@@_peek_nonspace_remove:NTF #1 { \@@_grab_D_call:Nw #1 } { - \msg_error:nnxx { cmd } { missing-required } + \msg_error:nnee { cmd } { missing-required } { \@@_environment_or_command: } { \token_to_str:N #1 } \@@_add_arg:n { \NoValue } @@ -4928,7 +4929,7 @@ \cs_new_protected:Npn \@@_grab_v_aux_loop_end: { \@@_grab_v_group_end: - \@@_add_arg:x { \tl_tail:N \l_@@_v_arg_tl } + \@@_add_arg:e { \tl_tail:N \l_@@_v_arg_tl } } % \end{macrocode} % \end{macro} @@ -4955,7 +4956,7 @@ % convert that token to a string, and remove the result as a % normal undelimited argument. % \begin{macrocode} -\cs_new_protected:Npx \@@_grab_v_bgroup: +\cs_new_protected:Npe \@@_grab_v_bgroup: { \exp_not:N \@@_grab_v_aux_catcodes: \exp_not:n { \int_set:Nn \l_@@_v_nesting_int { 1 } } @@ -5035,14 +5036,14 @@ \exp_after:wN \exp_after:wN \exp_after:wN \peek_meaning_remove:NTF \char_generate:nn { \tex_endlinechar:D } { 6 } { - \msg_error:nnxxx { cmd } { verbatim-nl } + \msg_error:nneee { cmd } { verbatim-nl } { \@@_environment_or_command: } { \tl_to_str:N \l_@@_v_arg_tl } { \tl_to_str:n {#1} } \@@_add_arg:n { \NoValue } } { - \msg_error:nnxxx { cmd } { verbatim-tokenized } + \msg_error:nneee { cmd } { verbatim-tokenized } { \@@_environment_or_command: } { \tl_to_str:N \l_@@_v_arg_tl } { \tl_to_str:n {#1} } @@ -5063,7 +5064,7 @@ % {Use~more~std~catcodes} \cs_new_protected:Npn \@@_grab_v_aux_put:N #1 { - \tl_put_right:Nx \l_@@_v_arg_tl + \tl_put_right:Ne \l_@@_v_arg_tl { \int_compare:nNnTF {`#1} = \tex_endlinechar:D { \exp_not:N \obeyedline } @@ -5114,7 +5115,7 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_add_arg:n, \@@_add_arg:V, \@@_add_arg:o, \@@_add_arg:x} +% \begin{macro}{\@@_add_arg:n, \@@_add_arg:V, \@@_add_arg:o, \@@_add_arg:e} % When an argument is found it is stored, then further arguments are % grabbed by calling \cs{l_@@_signature_tl}. % \begin{macrocode} @@ -5123,7 +5124,7 @@ \tl_put_right:Nn \l_@@_args_tl { {#1} } \l_@@_signature_tl \@@_run_code: } -\cs_generate_variant:Nn \@@_add_arg:n { V , o , x } +\cs_generate_variant:Nn \@@_add_arg:n { V , o , e } % \end{macrocode} % \end{macro} % @@ -5574,7 +5575,7 @@ { \int_compare:nNnTF {#1} > { #2 + 1 } { - \tl_set:Nx \ProcessedArgument + \tl_set:Ne \ProcessedArgument { \exp_last_unbraced:NnNo \@@_split_argument_aux:n @@ -5583,12 +5584,12 @@ \ProcessedArgument \q_stop } - \msg_error:nnxxx { cmd } { arg-split } + \msg_error:nneee { cmd } { arg-split } { \tl_to_str:n {#3} } { \int_eval:n { #2 + 1 } } { \tl_to_str:n {#4} } } { - \tl_put_right:Nx \ProcessedArgument + \tl_put_right:Ne \ProcessedArgument { \prg_replicate:nn { #2 + 1 - (#1) } { { \NoValue } } @@ -5618,7 +5619,7 @@ % This one is almost trivial. % \begin{macrocode} \cs_new_protected:Npn \@@_trim_spaces:n #1 - { \tl_set:Nx \ProcessedArgument { \tl_trim_spaces:n {#1} } } + { \tl_set:Ne \ProcessedArgument { \tl_trim_spaces:n {#1} } } % \end{macrocode} % \end{macro} % @@ -5667,7 +5668,7 @@ \bool_lazy_and:nnTF { \tl_if_head_is_group_p:n {#1} } { \tl_if_blank_p:o { \use_none:n #1 } } - { \tl_set:Nx \ProcessedArgument { #2 = { \exp_not:n #1 } } } + { \tl_set:Ne \ProcessedArgument { #2 = { \exp_not:n #1 } } } { \tl_if_blank:nTF {#1} { \tl_clear:N \ProcessedArgument } @@ -5838,10 +5839,10 @@ \tl_if_single_token:nTF {#1} { \int_set:Nn \tex_escapechar:D { 92 } - \exp_args:Nx \tl_if_empty:nTF + \exp_args:Ne \tl_if_empty:nTF { \exp_args:No \str_tail:n { \token_to_str:N #1 } } { - \exp_args:Nx \char_set_lccode:nn + \exp_args:Ne \char_set_lccode:nn { ` \str_head:n {#1} } { `? } \tex_lowercase:D { \tl_if_eq:nnTF {#1} } { ? } { \group_end: \use_iii:nnn } @@ -5851,11 +5852,11 @@ } { \group_end: \use_ii:nnn } { - \msg_error:nnxx { cmd } { not-definable } + \msg_error:nnee { cmd } { not-definable } { \tl_to_str:n {#1} } { \token_to_str:N #2 } } { - \msg_error:nnxx { cmd } { not-one-token } + \msg_error:nnee { cmd } { not-one-token } { \tl_to_str:n {#1} } { \token_to_str:N #2 } } } @@ -5877,7 +5878,7 @@ { \group_begin: \int_set:Nn \tex_escapechar:D { 92 } - \exp_args:Nx \tl_if_empty:nTF + \exp_args:Ne \tl_if_empty:nTF { \exp_args:No \str_tail:n { \token_to_str:N #1 } } { \group_end: \use_ii:nn } { \group_end: \use_i:nn } @@ -6426,7 +6427,7 @@ { \cs_if_exist:NTF #1 { - \msg_error:nnxx { cmd } { already-defined } + \msg_error:nnee { cmd } { already-defined } { \use:nnn \token_to_str:N #1 { } } { \token_to_str:N \NewDocumentCommand } } @@ -6440,7 +6441,7 @@ \cs_if_exist:NTF #1 { \@@_declare_cmd:Nnn #1 {#2} {#3} } { - \msg_error:nnxx { cmd } { undefined } + \msg_error:nnee { cmd } { undefined } { \use:nnn \token_to_str:N #1 { } } { \token_to_str:N \RenewDocumentCommand } } @@ -6499,13 +6500,13 @@ { \cs_if_exist:cTF {#1} { - \msg_error:nnx { cmd } { env-already-defined } {#1} + \msg_error:nne { cmd } { env-already-defined } {#1} \use_none:nnn } { \cs_if_exist:cTF { end #1 } { - \msg_error:nnx { cmd } { env-end-already-defined } {#1} + \msg_error:nne { cmd } { env-end-already-defined } {#1} \use_none:nnn } { \@@_declare_env:nnnn {#1} } @@ -6516,7 +6517,7 @@ \cs_if_exist:cTF {#1} { \@@_declare_env:nnnn {#1} } { - \msg_error:nnx { cmd } { env-undefined } {#1} + \msg_error:nne { cmd } { env-undefined } {#1} \use_none:nnn } } @@ -6583,7 +6584,7 @@ { \cs_if_exist:NTF #1 { - \msg_error:nnxx { cmd } { already-defined } + \msg_error:nnee { cmd } { already-defined } { \use:nnn \token_to_str:N #1 { } } { \token_to_str:N \NewExpandableDocumentCommand } } @@ -6597,7 +6598,7 @@ \cs_if_exist:NTF #1 { \@@_declare_expandable_cmd:Nnn #1 {#2} {#3} } { - \msg_error:nnxx { cmd } { undefined } + \msg_error:nnee { cmd } { undefined } { \use:nnn \token_to_str:N #1 { } } { \token_to_str:N \RenewExpandableDocumentCommand } } diff --git a/base/ltcmdhooks.dtx b/base/ltcmdhooks.dtx index 8af15eed24..25d2e0d5a1 100644 --- a/base/ltcmdhooks.dtx +++ b/base/ltcmdhooks.dtx @@ -20,7 +20,7 @@ %<*driver> % \fi \ProvidesFile{ltcmdhooks.dtx} - [2026-01-23 v1.0m LaTeX Kernel (Command hooks)] + [2026-03-12 v1.0n LaTeX Kernel (Command hooks)] % \iffalse % \documentclass{l3in2edoc} @@ -487,6 +487,8 @@ % \changes{v1.0b}{2021/05/24}{Use \cs{msg_...} instead of \cs{__kernel_msg...}} % \changes{v1.0j}{2024/04/17}{Use \cs{__kernel_cs_parameter_spec:N} instead % of \cs{cs_argument_spec:N}/\cs{cs_parameter_spec:N}} +% \changes{v1.0n}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % % \begin{macrocode} %<*2ekernel|latexrelease> @@ -569,20 +571,11 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_patch_debug:x} +% \begin{macro}{\@@_patch_debug:e} % A helper for patching debug info. % \begin{macrocode} -\cs_new_protected:Npn \@@_patch_debug:x #1 - { \@@_debug:n { \iow_term:x { [lthooks]~#1 } } } -% \end{macrocode} -% \end{macro} -% -% \subsection{Variants} -% -% \begin{macro}[int]{\tl_rescan:nV} -% \pkg{expl3} function variants used throughout the code. -% \begin{macrocode} -\cs_generate_variant:Nn \tl_rescan:nn { nV } +\cs_new_protected:Npn \@@_patch_debug:e #1 + { \@@_debug:n { \iow_term:e { [lthooks]~#1 } } } % \end{macrocode} % \end{macro} % @@ -706,7 +699,7 @@ \cs_new_protected:Npn \@@_cmd_try_patch:nn #1 #2 { \@@_debug:n - { \iow_term:x { ->~\string\begin{document}~try~cmd / #1 / #2. } } + { \iow_term:e { ->~\string\begin{document}~try~cmd / #1 / #2. } } \@@_if_declared:nTF { cmd / #1 / #2 } { \@@_debug:n @@ -738,17 +731,17 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_patch_command:Nnn #1 #2 #3 { - \@@_patch_debug:x { analyzing~'\token_to_str:N #1' } - \@@_patch_debug:x { \token_to_str:N #1 = \token_to_meaning:N #1 } + \@@_patch_debug:e { analyzing~'\token_to_str:N #1' } + \@@_patch_debug:e { \token_to_str:N #1 = \token_to_meaning:N #1 } \@@_patch_check:NNnn \cs_if_exist:NTF #1 { undef } { - \@@_patch_debug:x { ++~control~sequence~is~defined } + \@@_patch_debug:e { ++~control~sequence~is~defined } \@@_patch_check:NNnn \token_if_macro:NTF #1 { macro } { - \@@_patch_debug:x { ++~control~sequence~is~a~macro } + \@@_patch_debug:e { ++~control~sequence~is~a~macro } \@@_patch_check:NNnn \@@_if_public_command:NTF #1 { expl3 } { - \@@_patch_debug:x { ++~macro~is~not~private } + \@@_patch_debug:e { ++~macro~is~not~private } \robust@command@act \g_hook_patch_action_list_tl #1 \@@_retokenize_patch:Nnn { #1 {#2} {#3} } @@ -764,7 +757,7 @@ { #1 #2 {#4} { - \msg_error:nnxx { hooks } { cant-patch } + \msg_error:nnee { hooks } { cant-patch } { \token_to_str:N #2 } {#3} } } @@ -774,14 +767,14 @@ % with |:D| in their name could be included here, but they are already % discarded in the \cs{token_if_macro:NTF} test above. % \begin{macrocode} -\use:x +\use:e { \prg_new_protected_conditional:Npnn - \exp_not:N \@@_if_public_command:N ##1 { TF } + \exp_not:N \@@_if_public_command:N #1 { TF } { \exp_not:N \exp_last_unbraced:Nf \exp_not:N \@@_if_public_command:w - { \exp_not:N \cs_to_str:N ##1 } + { \exp_not:N \cs_to_str:N #1 } \tl_to_str:n { _ _ } \s_@@_mark } } @@ -961,7 +954,7 @@ % {cmd~hooks~with~args} \cs_new_protected:Npn \@@_patch_expand_redefine:NNnn #1 #2 #3 #4 { - \@@_patch_debug:x { ++~command~can~be~patched~without~rescanning } + \@@_patch_debug:e { ++~command~can~be~patched~without~rescanning } % \end{macrocode} % We'll start by counting the number of arguments in the command by % counting the number of characters in the \cs{cs_parameter_spec:N} of @@ -1002,7 +995,7 @@ % \cs{@@_if_has_hash:nTF} to avoid testing twice (the test can be % rather slow). % \begin{macrocode} - \tl_set:Nx \l_@@_tmpa_tl { \bool_if:NTF #1 { [ ] } { { } } } + \tl_set:Ne \l_@@_tmpa_tl { \bool_if:NTF #1 { [ ] } { { } } } \int_step_inline:nnn { 2 } { \l_@@_patch_num_args_int } { \tl_put_right:Nn \l_@@_tmpa_tl { { } } } \exp_args:NNo \exp_args:No \@@_if_has_hash:nTF @@ -1021,22 +1014,22 @@ % {Rename to \cs{c__hook_hashes_tl} (hook-args)} % \begin{macrocode} \bool_if:NTF #1 - { \@@_tmp:w \tl_set:Nx { [ \c_@@_hashes_tl 1 ] } } - { \@@_tmp:w \tl_set:Nx { { \c_@@_hashes_tl 1 } } } + { \@@_tmp:w \tl_set:Ne { [ \c_@@_hash_tl 1 ] } } + { \@@_tmp:w \tl_set:Ne { { \c_@@_hash_tl 1 } } } % \end{macrocode} % Then, for every parameter from the second, just add it normally: % \begin{macrocode} \int_step_inline:nnn { 2 } { \l_@@_patch_num_args_int } - { \@@_tmp:w \tl_put_right:Nx { { \c_@@_hashes_tl ##1 } } } + { \@@_tmp:w \tl_put_right:Ne { { \c_@@_hash_tl ##1 } } } % \end{macrocode} % Now, if the command has any parameter token in its definition % (then \cs{@@_exp_not:n} is \cs{exp_not:n}), call % \cs{@@_double_hashes:n} to double them, and replace every % \cs{c_@@_hashes_tl} by |#|: % \begin{macrocode} - \tl_set:Nx \l_@@_replace_text_tl + \tl_set:Ne \l_@@_replace_text_tl { \exp_not:N #2 \exp_not:V \l_@@_replace_text_tl } - \tl_set:Nx \l_@@_replace_text_tl + \tl_set:Ne \l_@@_replace_text_tl { \token_if_eq_meaning:NNTF \@@_exp_not:n \exp_not:n { \exp_args:NNV \exp_args:No \@@_double_hashes:n } @@ -1073,10 +1066,10 @@ % \begin{macrocode} \group_begin: \int_set:Nn \tex_escapechar:D { `\/ } - \use:x + \use:e { \group_end: - \tl_set:Nx \exp_not:N \l_@@_patch_prefixes_tl + \tl_set:Ne \exp_not:N \l_@@_patch_prefixes_tl { \exp_not:N \@@_make_prefixes:w \cs_prefix_spec:N #2 / / } } % \end{macrocode} @@ -1121,7 +1114,7 @@ % {cmd~hooks~with~args} %\cs_gset_protected:Npn \@@_patch_expand_redefine:NNnn #1 #2 #3 #4 % { -% \@@_patch_debug:x { ++~command~can~be~patched~without~rescanning } +% \@@_patch_debug:e { ++~command~can~be~patched~without~rescanning } % \int_set:Nn \l_@@_patch_num_args_int % { % \exp_args:Nf \str_count:n { \__kernel_cs_parameter_spec:N #2 } / 2 @@ -1407,7 +1400,7 @@ \str_if_eq:eeTF { \__kernel_cs_parameter_spec:N #1 } { } { \@@_patch_expand_redefine:NNnn \c_false_bool #1 {#2} {#3} } { - \@@_patch_debug:x { ..~command~can~only~be~patched~by~rescanning } + \@@_patch_debug:e { ..~command~can~only~be~patched~by~rescanning } % \end{macrocode} % % Otherwise, we start the actual patching by retokenization job. The @@ -1425,18 +1418,18 @@ % from the command whose name is~|#2|). % \changes{v1.0l}{2025/10/12}{Reset the catcode of space when patching} % \begin{macrocode} - \tl_set:Nx \l_@@_tmpa_tl + \tl_set:Ne \l_@@_tmpa_tl { \int_compare:nNnTF { \char_value_catcode:n {`\@ } } = { 12 } { \exp_not:N \makeatletter } { \exp_not:N \makeatother } } - \tl_set:Nx \l_@@_tmpb_tl + \tl_set:Ne \l_@@_tmpb_tl { \bool_if:NTF \l__kernel_expl_bool { \ExplSyntaxOff } { \ExplSyntaxOn \char_set_catcode_space:n { 32 }} } - \use:x + \use:e { \exp_not:N \@@_try_patch_with_catcodes:Nnnnw \exp_not:n { #1 {#2} {#3} } @@ -1455,7 +1448,7 @@ % command isn't changed in any way in that case. % \begin{macrocode} { - \msg_error:nnxx { hooks } { cant-patch } + \msg_error:nnee { hooks } { cant-patch } { \c_backslash_str #2 } { retok } } } @@ -1475,16 +1468,16 @@ \cs_new_protected:Npn \@@_try_patch_with_catcodes:Nnnnw #1 #2 #3 #4 { \quark_if_recursion_tail_stop_do:nn {#4} { \use:n } - \@@_patch_debug:x { ++~trying~to~patch~by~retokenization } + \@@_patch_debug:e { ++~trying~to~patch~by~retokenization } \@@_cmd_if_scanable:NnTF {#1} {#4} { - \@@_patch_debug:x { ++~macro~can~be~retokenized~cleanly } - \@@_patch_debug:x { ==~retokenizing~macro~now } + \@@_patch_debug:e { ++~macro~can~be~retokenized~cleanly } + \@@_patch_debug:e { ==~retokenizing~macro~now } \@@_patch_retokenize:Nnnn #1 { cmd / #2 / #3 } {#3} {#4} \use_i_delimit_by_q_recursion_stop:nw \use_none:n } { - \@@_patch_debug:x { --~macro~cannot~be~retokenized~cleanly } + \@@_patch_debug:e { --~macro~cannot~be~retokenized~cleanly } \@@_try_patch_with_catcodes:Nnnnw #1 {#2} {#3} } } @@ -1494,16 +1487,16 @@ %\cs_gset_protected:Npn \@@_try_patch_with_catcodes:Nnnnw #1 #2 #3 #4 % { % \quark_if_recursion_tail_stop_do:nn {#4} { \use:n } -% \@@_patch_debug:x { ++~trying~to~patch~by~retokenization } +% \@@_patch_debug:e { ++~trying~to~patch~by~retokenization } % \@@_cmd_if_scanable:NnTF {#1} {#4} % { -% \@@_patch_debug:x { ++~macro~can~be~retokenized~cleanly } -% \@@_patch_debug:x { ==~retokenizing~macro~now } +% \@@_patch_debug:e { ++~macro~can~be~retokenized~cleanly } +% \@@_patch_debug:e { ==~retokenizing~macro~now } % \@@_patch_retokenize:Nnnn #1 {#2} {#3} {#4} % \use_i_delimit_by_q_recursion_stop:nw \use_none:n % } % { -% \@@_patch_debug:x { --~macro~cannot~be~retokenized~cleanly } +% \@@_patch_debug:e { --~macro~cannot~be~retokenized~cleanly } % \@@_try_patch_with_catcodes:Nnnnw #1 {#2} {#3} % } % } @@ -1598,12 +1591,12 @@ { \cs_set_eq:NN \kerneltmpDoNotUse \scan_stop: \cs_set_eq:NN \@@_tmp:w \scan_stop: - \use:x + \use:e { \cs_set:Npn \@@_tmp:w - ####1 \tl_to_str:n { macro: } ####2 -> ####3 \s_@@_mark - { ####1 \def \kerneltmpDoNotUse ####2 {####3} } - \tl_set:Nx \exp_not:N \l_@@_tmpa_tl + ##1 \tl_to_str:n { macro: } ##2 -> ##3 \s_@@_mark + { ##1 \def \kerneltmpDoNotUse ##2 {##3} } + \tl_set:Ne \exp_not:N \l_@@_tmpa_tl { \exp_not:N \@@_tmp:w \token_to_meaning:N #1 \s_@@_mark } } \tl_rescan:nV { #2 \@@_patch_required_catcodes: } \l_@@_tmpa_tl @@ -1634,7 +1627,7 @@ \token_to_meaning:N #1 \s_@@_mark } \exp_last_unbraced:NNNNo -\cs_new_protected:Npx \@@_guess_arg_count:wN +\cs_new_protected:Npe \@@_guess_arg_count:wN #1 { \tl_to_str:n { macro: } } #2 \s_@@_mark #3 { \int_set:Nn #3 @@ -1689,10 +1682,10 @@ \@@_make_usable:nn {#2} { \l_@@_patch_num_args_int } \tl_set:Ne \l_@@_tmpa_tl { \exp_args:Ne \tl_to_str:n { \@@_braced_parameter:n {#2} } } - \use:x + \use:e { \str_replace_all:Nnn \exp_not:N \l_@@_tmpa_tl - { #### } { \c_hash_str } + { ## } { \c_hash_str } } % \end{macrocode} % Then, make some things \tn{relax} to avoid lots of @@ -1700,7 +1693,7 @@ % \begin{macrocode} \cs_set_eq:NN \kerneltmpDoNotUse \scan_stop: \cs_set_eq:NN \@@_tmp:w \scan_stop: - \use:x + \use:e { % \end{macrocode} % Now we'll define \cs{@@_tmp:w} such that it splits the \tn{meaning} @@ -1716,9 +1709,9 @@ % accordingly. % \begin{macrocode} \cs_set:Npn \@@_tmp:w - ####1 \tl_to_str:n { macro: } ####2 -> ####3 \s_@@_mark + ##1 \tl_to_str:n { macro: } ##2 -> ##3 \s_@@_mark { - ####1 \def \kerneltmpDoNotUse ####2 + ##1 \def \kerneltmpDoNotUse ##2 { \str_if_eq:nnT {#3} { before } { @@ -1726,7 +1719,7 @@ { \int_use:N \l_@@_patch_num_args_int } \l_@@_tmpa_tl } - ####3 + ##3 \str_if_eq:nnT {#3} { after } { \token_to_str:N \UseHookWithArguments {#2} @@ -1739,7 +1732,7 @@ % Now we just have to get the \tn{meaning} of the command being % patched and pass it through the meat grinder above. % \begin{macrocode} - \tl_set:Nx \exp_not:N \l_@@_tmpa_tl + \tl_set:Ne \exp_not:N \l_@@_tmpa_tl { \exp_not:N \@@_tmp:w \token_to_meaning:N #1 \s_@@_mark } } % \end{macrocode} diff --git a/base/ltexpl.dtx b/base/ltexpl.dtx index b40d61b007..6ba526b27a 100644 --- a/base/ltexpl.dtx +++ b/base/ltexpl.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltexpl.dtx} - [2025/06/05 v1.3l LaTeX Kernel (expl3-dependent code)] + [2026-03-13 v1.3m LaTeX Kernel (expl3-dependent code)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltexpl.dtx} @@ -303,6 +303,23 @@ %\EndIncludeInRelease % \end{macrocode} % +% \changes{v1.3m}{2026-03-13}{Add check for sufficiently-recent expl3} +% We need to be sure that \pkg{expl3} is sufficiently new that all of the +% required functions exist. As the mechanism for date checking isn't +% in place yet, that is done using a marker function. We use the same +% abort trick as earlier. +% \begin{macrocode} +\ifcsname\detokenize{tl_if_head_eq_charcode:eNTF}\endcsname +\else + \def~{ }\def\MessageBreak{^^J~~~~~~~~~~~~~~~}% + \errmessage{LaTeX Error: + L3 Programming layer too old.\MessageBreak + You need to update your installation of 'l3kernel'.\MessageBreak + LaTeX will abort!}% + \batchmode \read -1 to \reserved@a +\fi +% \end{macrocode} +% % Now in |latexrelease| mode, redefine a few commands to avoid ``already % defined'' errors. % \changes{v1.3f}{2022/02/28} diff --git a/base/ltfilehook.dtx b/base/ltfilehook.dtx index 843cf5a304..9c0e67989f 100644 --- a/base/ltfilehook.dtx +++ b/base/ltfilehook.dtx @@ -34,8 +34,8 @@ %\iffalse %<*driver,structuredlog> %\fi -\def\ltfilehookdate{2026-01-23} -\def\ltfilehookversion{v1.0o} +\def\ltfilehookdate{2026-03-12} +\def\ltfilehookversion{v1.0p} %\iffalse % %<*driver> @@ -499,7 +499,8 @@ % \end{macrocode} % % \changes{v1.0k}{2021/05/24}{Use \cs{msg_...} instead of \cs{__kernel_msg...}} -% +% \changes{v1.0p}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % % \subsection{Document and package-level commands} % @@ -601,7 +602,7 @@ } \cs_new_protected:Npn \@@_drop_extension:N #1 { - \tl_gset:Nx #1 + \tl_gset:Ne #1 { \exp_args:NV \@@_file_parse_full_name:nN #1 \@@_drop_extension_aux:nnn @@ -633,7 +634,7 @@ { \seq_new:N \g_@@_input_file_seq } \cs_new_protected:Npn \@@_file_push: { - \seq_gpush:Nx \g_@@_input_file_seq + \seq_gpush:Ne \g_@@_input_file_seq { { \CurrentFilePathUsed } { \CurrentFileUsed } { \CurrentFilePath } { \CurrentFile } @@ -960,9 +961,9 @@ \cs_new_protected:Npn \@@_subst_add:nn #1 #2 { \group_begin: - \cs_set:cpx { } { \exp_not:o { \cs:w\cs_end: } } + \cs_set:cpe { } { \exp_not:o { \cs:w\cs_end: } } \int_set:Nn \tex_escapechar:D { -1 } - \cs_gset:cpx + \cs_gset:cpe { @file-subst@ \@@_subst_file_normalize:Nn \use_ii_iii:nnn {#1} @@ -974,7 +975,7 @@ \cs_new_protected:Npn \@@_subst_remove:n #1 { \group_begin: - \cs_set:cpx { } { \exp_not:o { \cs:w\cs_end: } } + \cs_set:cpe { } { \exp_not:o { \cs:w\cs_end: } } \int_set:Nn \tex_escapechar:D { -1 } \cs_undefine:c { @@ -1723,7 +1724,7 @@ \cs_new_protected:Npn \@@_log_file_record:n #1 { \str_if_eq:nnT {#1} {START} { \int_gincr:N \g_@@_nesting_level_int } - \iow_term:x + \iow_term:e { \prg_replicate:nn { \g_@@_nesting_level_int } { = } ~ ( LEVEL ~ \int_use:N \g_@@_nesting_level_int \c_space_tl #1 ) ~ @@ -1819,7 +1820,7 @@ % % \begin{macrocode} \cs_new:Npn\atveryend@DEPRECATED #1 - {\iow_term:x{======~DEPRECATED~USAGE~#1~==========}} + {\iow_term:e{======~DEPRECATED~USAGE~#1~==========}} \ExplSyntaxOff % \end{macrocode} % \end{macro} diff --git a/base/ltfinal.dtx b/base/ltfinal.dtx index fe7b1dbca0..8d23abe65f 100644 --- a/base/ltfinal.dtx +++ b/base/ltfinal.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltfinal.dtx} - [2026/02/25 v2.3j LaTeX Kernel (Final Settings)] + [2026-03-12 v2.3k LaTeX Kernel (Final Settings)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltfinal.dtx} @@ -92,7 +92,8 @@ % \changes{v2.0r}{2016/10/15}{Require e\TeX{}} % \changes{v2.0s}{2016/10/15}{Tidy up status of char 127} % \changes{v2.2i}{2020/08/21}{Integration of new hook management interface} -% +% \changes{v2.3k}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % % % @@ -1210,11 +1211,11 @@ \cs_set_nopar:Npn \reserved@b { first } \tl_if_blank:nTF {#2} { - \str_set:Nx \reserved@a + \str_set:Ne \reserved@a { \BCPdata { casing } } \str_if_empty:NT \reserved@a { - \str_set:Nx \reserved@a + \str_set:Ne \reserved@a { \BCPdata { language } } } } diff --git a/base/ltfssdcl.dtx b/base/ltfssdcl.dtx index 2208b967da..abe2640cb9 100644 --- a/base/ltfssdcl.dtx +++ b/base/ltfssdcl.dtx @@ -36,7 +36,7 @@ % % \ProvidesFile{ltfssdcl.dtx} - [2025/09/19 v3.1e LaTeX Kernel (NFSS Declarative Interface)] + [2026-03-12 v3.1f LaTeX Kernel (NFSS Declarative Interface)] % \iffalse \documentclass{ltxdoc} \begin{document} @@ -89,6 +89,8 @@ % {(DPC) Make file from previous file, latint.dtx 1995/05/21 v2.1t} % \changes{v3.0p}{2015/02/21} % {Removed autoload code} +% \changes{v3.1f}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % % % \changes{v2.1o}{1994/11/22} @@ -705,7 +707,7 @@ Allocated~math~groups:~\int_use:c{ c@mv@ #1 }~ (local:~ \int_use:N\c@localmathalphabets) } \cs_gset_eq:cc { mv@#1@frozen }{ mv@#1 } - \tl_gset:cx { g__nfss_frozen_mv_ #1 _tl }{ \int_use:c { c@mv@#1 } } + \tl_gset:ce { g__nfss_frozen_mv_ #1 _tl }{ \int_use:c { c@mv@#1 } } % \end{macrocode} % Here is the definition of \cs{mv@\meta{version}@reset}. If there % has been no new math alphabet allocation, doing a reset would diff --git a/base/lthooks.dtx b/base/lthooks.dtx index 734caa6bcd..c088ab0d4a 100644 --- a/base/lthooks.dtx +++ b/base/lthooks.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{lthooks.dtx} - [2026-03-10 v1.1n LaTeX Kernel (hooks)] + [2026-03-13 v1.1o LaTeX Kernel (hooks)] % \iffalse % \documentclass{l3in2edoc} @@ -2337,6 +2337,8 @@ % % \changes{v1.0i}{2021/03/18}{Use \cs{NewModuleRelease}.} % \changes{v1.0n}{2021/05/24}{Use \cs{msg_...} instead of \cs{__kernel_msg...}} +% \changes{v1.1o}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % % \begin{macrocode} %<*2ekernel|latexrelease> @@ -2372,7 +2374,7 @@ } \cs_new_protected:Npn \@@_debug_gset: { - \cs_gset_protected:Npx \@@_debug:n ##1 + \cs_gset_protected:Npe \@@_debug:n ##1 { \bool_if:NT \g_@@_debug_bool {##1} } } % \end{macrocode} @@ -2473,23 +2475,12 @@ % \end{macro} % % \begin{macro}[int]{ -% \tl_gremove_once:Nx, -% \tl_show:x, -% \tl_log:x, -% \tl_set:Ne, -% \cs_replacement_spec:c, -% \prop_put:Nne, % \str_count:e % } +% \changes{v1.1o}{2026-03-13}{Tidy up variants} % Some variants of \pkg{expl3} functions. % \fmiinline{should probably be moved to expl3} % \begin{macrocode} -\cs_generate_variant:Nn \tl_gremove_once:Nn { Nx } -\cs_generate_variant:Nn \tl_show:n { x } -\cs_generate_variant:Nn \tl_log:n { x } -\cs_generate_variant:Nn \tl_set:Nn { Ne } -\cs_generate_variant:Nn \cs_replacement_spec:N { c } -\cs_generate_variant:Nn \prop_put:Nnn { Nne } \cs_generate_variant:Nn \str_count:n { e } % \end{macrocode} % \end{macro} @@ -2530,20 +2521,20 @@ % {Clean-up unused variants (hook-args).} % \begin{macrocode} \cs_new_protected:Npn \@@_tl_set:cn #1#2 - { \cs_set_nopar:cpx {#1} { \__kernel_exp_not:w {#2} } } + { \cs_set_nopar:cpe {#1} { \__kernel_exp_not:w {#2} } } % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_tl_gset:Nn,\@@_tl_gset:Nx, -% \@@_tl_gset:cn,\@@_tl_gset:co,\@@_tl_gset:cx} +% \begin{macro}{\@@_tl_gset:Nn,\@@_tl_gset:Ne, +% \@@_tl_gset:cn,\@@_tl_gset:co,\@@_tl_gset:ce} % Same as above. % \begin{macrocode} \cs_new_protected:Npn \@@_tl_gset:Nn #1#2 - { \cs_gset_nopar:Npx #1 { \__kernel_exp_not:w {#2} } } -\cs_new_protected:Npn \@@_tl_gset:Nx #1#2 - { \cs_gset_nopar:Npx #1 {#2} } + { \cs_gset_nopar:Npe #1 { \__kernel_exp_not:w {#2} } } +\cs_new_protected:Npn \@@_tl_gset:Ne #1#2 + { \cs_gset_nopar:Npe #1 {#2} } \cs_generate_variant:Nn \@@_tl_gset:Nn { c, co } -\cs_generate_variant:Nn \@@_tl_gset:Nx { c } +\cs_generate_variant:Nn \@@_tl_gset:Ne { c } % \end{macrocode} % \end{macro} % @@ -2555,7 +2546,7 @@ % Same as above. % \begin{macrocode} \cs_new_protected:Npn \@@_tl_gput_right:Nn #1#2 - { \@@_tl_gset:Nx #1 { \__kernel_exp_not:w \exp_after:wN { #1 #2 } } } + { \@@_tl_gset:Ne #1 { \__kernel_exp_not:w \exp_after:wN { #1 #2 } } } \cs_generate_variant:Nn \@@_tl_gput_right:Nn { Ne, cn } % \end{macrocode} % \end{macro} @@ -2565,7 +2556,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_tl_gput_left:Nn #1#2 { - \@@_tl_gset:Nx #1 + \@@_tl_gset:Ne #1 { \__kernel_exp_not:w {#2} \__kernel_exp_not:w \exp_after:wN {#1} } } % \end{macrocode} @@ -2876,7 +2867,7 @@ { \tl_const:cn { c_@@_#1_parameter_tl } } {#2} { \msg_error:nnnn { hooks } { too-many-args } {#1} {#2} - \tl_const:cx { c_@@_#1_parameter_tl } + \tl_const:ce { c_@@_#1_parameter_tl } { \exp_not:V \c_@@_nine_parameters_tl } } % \end{macrocode} @@ -3264,7 +3255,7 @@ { \tl_new:c { g_@@_#1_declared_tl } \@@_make_usable:nn {#1} { 0 } - \tl_gset:cx { g_@@_#1_reversed_tl } + \tl_gset:ce { g_@@_#1_reversed_tl } { \@@_if_generic_reversed:nT {#1} { - } } % \end{macrocode} % Reflect that we have activated the generic hook and set its @@ -3529,7 +3520,7 @@ % stack and sets the new default label (all in one go): % \begin{macrocode} \cs_new_protected:Npn \@@_curr_name_push:n #1 - { \exp_args:Nx \@@_curr_name_push_aux:n { \@@_make_name:n {#1} } } + { \exp_args:Ne \@@_curr_name_push_aux:n { \@@_make_name:n {#1} } } \cs_new_protected:Npn \@@_curr_name_push_aux:n #1 { \tl_if_blank:nTF {#1} @@ -3570,7 +3561,7 @@ { \seq_gpop:NNT \g_@@_name_stack_seq \l_@@_return_tl { - \msg_error:nnx { hooks } { missing-pop-label } + \msg_error:nne { hooks } { missing-pop-label } { \g_@@_hook_curr_name_tl } \tl_gset_eq:NN \g_@@_hook_curr_name_tl \l_@@_return_tl \@@_end_document_label_check: @@ -3592,7 +3583,7 @@ \msg_error:nnnnn { hooks } { set-top-level } { for } { SetDefaultHookLabel } {#1} } - { \exp_args:Nx + { \exp_args:Ne \@@_set_default_label:n { \@@_make_name:n {#1} } } } \cs_new_protected:Npn \@@_set_default_label:n #1 @@ -3726,7 +3717,7 @@ % However, first some debugging info if debugging is enabled: % \changes{v1.1l}{2024/11/26}{Adjust debugging message (gh/1459)} % \begin{macrocode} - \@@_debug:n{\iow_term:x{[lthooks]~ Add~ to~ + \@@_debug:n{\iow_term:e{[lthooks]~ Add~ to~ \@@_if_usable:nF {#1} { undeclared~ } hook~ '#1'~ (#2) \on@line ^^J [lthooks] \@spaces @@ -3767,7 +3758,7 @@ % otherwise becomes a major performance issue when the contents of % the hook are long. % \begin{macrocode} - \exp_args:Nx \@@_prop_gput_labeled_cleanup:nnn + \exp_args:Ne \@@_prop_gput_labeled_cleanup:nnn { \@@_if_replacing_args:TF { \exp_not:n } @@ -3781,16 +3772,16 @@ {#1} {#2} } } -\cs_new:Npx \@@_hash_check:nTF #1 +\cs_new:Npe \@@_hash_check:nTF #1 { \exp_not:N \exp_after:wN \exp_not:N \@@_hash_check_aux:w \exp_not:N \tl_to_str:n {#1} \c_hash_str \c_hash_str \exp_not:N \q_stop } -\use:x +\use:e { \cs_new:Npn \exp_not:N \@@_hash_check_aux:w - ##1 \c_hash_str ##2 \c_hash_str ##3 \exp_not:N \q_stop + #1 \c_hash_str #2 \c_hash_str #3 \exp_not:N \q_stop } { \tl_if_empty:nTF {#3} } % \end{macrocode} @@ -4617,7 +4608,7 @@ {#1} {#2} } \cs_new_protected:Npn \@@_cs_gput_right_fast:nnn #1 #2 #3 - { \cs_gset:cpx { @@#1~#2 } + { \cs_gset:cpe { @@#1~#2 } { \exp_not:v { @@#1~#2 } \exp_not:n {#3} } } \cs_new_protected:Npn \@@_cs_gput_right_slow:nnn #1 #2 #3 { @@ -4851,7 +4842,7 @@ % \cs{prop_map_function:NN}, taking a label name in \verb|##1| and the % code stored in that label in \verb|##2|. % \begin{macrocode} - \cs_gset_protected:Npx \@@_normalise_fn:nn ##1 ##2 + \cs_gset_protected:Npe \@@_normalise_fn:nn ##1 ##2 { % \end{macrocode} % Here we'll define two auxiliary macros: the first one throws an @@ -5262,7 +5253,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_rule_before_gset:nnn #1#2#3 { - \@@_tl_gset:cx + \@@_tl_gset:ce { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl } { \@@_label_ordered:nnTF {#2} {#3} { < } { > } } } @@ -5272,7 +5263,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_rule_after_gset:nnn #1#2#3 { - \@@_tl_gset:cx + \@@_tl_gset:ce { g_@@_#1_rule_ \@@_label_pair:nn {#3} {#2} _tl } { \@@_label_ordered:nnTF {#3} {#2} { < } { > } } } @@ -5286,7 +5277,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_rule_voids_gset:nnn #1#2#3 { - \@@_tl_gset:cx + \@@_tl_gset:ce { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl } { \@@_label_ordered:nnTF {#2} {#3} { -> } { <- } } } @@ -5419,10 +5410,10 @@ % \begin{macrocode} \@@_debug:n { - \iow_term:x { ^^J[lthooks]~ All~initialized~(non-empty)~hooks: } + \iow_term:e { ^^J[lthooks]~ All~initialized~(non-empty)~hooks: } \prop_map_inline:Nn \g_@@_used_prop { - \iow_term:x + \iow_term:e { ^^J ~ ##1 ~ -> ~ \cs_replacement_spec:c { @@~##1 } ~ } } } @@ -5482,7 +5473,7 @@ \cs_new_protected:Npn \@@_initialize_hook_code:n #1 { \@@_debug:n - { \iow_term:x { ^^J[lthooks]~ Update~code~for~hook~'#1' \on@line :^^J } } + { \iow_term:e { ^^J[lthooks]~ Update~code~for~hook~'#1' \on@line :^^J } } % \end{macrocode} % This does the sorting and the updates. % First thing we do is to check if a legacy hook macro exists and @@ -5552,7 +5543,7 @@ % arbitrary. % \begin{macrocode} \@@_debug:n - { \exp_args:NNx \prop_gput:Nnn \g_@@_used_prop {#1} { } } + { \exp_args:NNe \prop_gput:Nnn \g_@@_used_prop {#1} { } } } } } @@ -5778,7 +5769,7 @@ % \changes{v1.1l}{2024/11/26}{Adjust debugging message (gh/1459)} % \begin{macrocode} \@@_clist_gput:NV #2 \l_@@_front_tl - \@@_debug:n{ \iow_term:x{[lthooks]~ Handled~ code~ for~ \l_@@_front_tl} } + \@@_debug:n{ \iow_term:e{[lthooks]~ Handled~ code~ for~ \l_@@_front_tl} } % \end{macrocode} % % This is step T6, except that we don't use a pointer $P$ to move @@ -5787,7 +5778,7 @@ % \begin{macrocode} \seq_map_inline:cn { \@@_seq_csname:n { \l_@@_front_tl } } { - \tl_set:cx { \@@_tl_csname:n {##1} } + \tl_set:ce { \@@_tl_csname:n {##1} } { \int_eval:n { \cs:w \@@_tl_csname:n {##1} \cs_end: - 1 } } @@ -5813,15 +5804,15 @@ } \int_compare:nNnF \l_@@_labels_int = 0 { - \iow_term:x{====================} - \iow_term:x{Error:~ label~ rules~ are~ incompatible:} + \iow_term:e{====================} + \iow_term:e{Error:~ label~ rules~ are~ incompatible:} % \end{macrocode} % % This is not really the information one needs in the error case % but it will do for now \ldots \fmiinline{improve output on a rainy day} % \begin{macrocode} \@@_debug_label_data:N \l_@@_work_prop - \iow_term:x{====================} + \iow_term:e{====================} } % \end{macrocode} % After we have added all hook code to \verb=#1=, we finish it off @@ -6033,14 +6024,14 @@ \cs_new_protected:cpn { @@_apply_rule_<:nnn } #1#2#3 { \@@_debug:n { \@@_msg_pair_found:nnn {#1} {#2} {#3} } - \tl_set:cx { \@@_tl_csname:n {#2} } + \tl_set:ce { \@@_tl_csname:n {#2} } { \int_eval:n{ \cs:w \@@_tl_csname:n {#2} \cs_end: + 1 } } \seq_put_right:cn{ \@@_seq_csname:n {#1} }{#2} } \cs_new_protected:cpn { @@_apply_rule_>:nnn } #1#2#3 { \@@_debug:n { \@@_msg_pair_found:nnn {#1} {#2} {#3} } - \tl_set:cx { \@@_tl_csname:n {#1} } + \tl_set:ce { \@@_tl_csname:n {#1} } { \int_eval:n{ \cs:w \@@_tl_csname:n {#1} \cs_end: + 1 } } \seq_put_right:cn{ \@@_seq_csname:n {#2} }{#1} } @@ -6091,7 +6082,7 @@ \@@_debug:n { \@@_msg_pair_found:nnn {#1} {#2} {#3} - \iow_term:x{--->~ Drop~ '#2'~ code~ from~ + \iow_term:e{--->~ Drop~ '#2'~ code~ from~ \iow_char:N \\ g_@@_ \l_@@_cur_hook_tl _code_prop ~ because~ of~ '#1' } } @@ -6102,7 +6093,7 @@ \@@_debug:n { \@@_msg_pair_found:nnn {#1} {#2} {#3} - \iow_term:x{--->~ Drop~ '#1'~ code~ from~ + \iow_term:e{--->~ Drop~ '#1'~ code~ from~ \iow_char:N \\ g_@@_ \l_@@_cur_hook_tl _code_prop ~ because~ of~ '#2' } } @@ -6136,7 +6127,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_msg_pair_found:nnn #1#2#3 { - \iow_term:x{~ \str_if_eq:nnTF {#3} {??} {default} {~normal} ~ + \iow_term:e{~ \str_if_eq:nnTF {#3} {??} {default} {~normal} ~ rule~ \@@_label_pair:nn {#1} {#2}:~ \use:c { g_@@_#3_rule_ \@@_label_pair:nn {#1} {#2} _tl } ~ found} @@ -6149,16 +6140,16 @@ % % \begin{macrocode} \cs_new_protected:Npn \@@_debug_label_data:N #1 { - \iow_term:x{Code~ labels~ for~ sorting:} - \iow_term:x{~ \seq_use:Nnnn\l_@@_labels_seq {~and~}{,~}{~and~} } - \iow_term:x{^^J Data~ structure~ for~ label~ rules:} + \iow_term:e{Code~ labels~ for~ sorting:} + \iow_term:e{~ \seq_use:Nnnn\l_@@_labels_seq {~and~}{,~}{~and~} } + \iow_term:e{^^J Data~ structure~ for~ label~ rules:} \prop_map_inline:Nn #1 { - \iow_term:x{~ ##1~ =~ \tl_use:c{ \@@_tl_csname:n {##1} }~ ->~ + \iow_term:e{~ ##1~ =~ \tl_use:c{ \@@_tl_csname:n {##1} }~ ->~ \seq_use:cnnn{ \@@_seq_csname:n {##1} }{~->~}{~->~}{~->~} } } - \iow_term:x{} + \iow_term:e{} } % \end{macrocode} % \end{macro} @@ -6167,7 +6158,7 @@ % % \begin{macro}{\hook_show:n,\hook_log:n} % \changes{v1.1m}{2025/06/27}{Support \cs{showstream} (gh/1062)} -% \begin{macro}{\@@_log_line:x,\@@_log_line_indent:x} +% \begin{macro}{\@@_log_line:e,\@@_log_line_indent:e} % \begin{macro}{\@@_log:nN} % This writes out information about the hook given in its argument % onto the \texttt{.log} file and the terminal, if \cs{show_hook:n} is @@ -6176,28 +6167,28 @@ % \begin{macrocode} \cs_new_protected:Npn \hook_log:n #1 { - \cs_set_eq:NN \@@_log_cmd:x \iow_log:x - \@@_normalize_hook_args:Nn \@@_log:nN {#1} \tl_log:x + \cs_set_eq:NN \@@_log_cmd:e \iow_log:e + \@@_normalize_hook_args:Nn \@@_log:nN {#1} \tl_log:e } \cs_if_exist:NTF \iow_show:e { \cs_new_protected:Npn \hook_show:n #1 { - \cs_set_eq:NN \@@_log_cmd:x \iow_show:e - \@@_normalize_hook_args:Nn \@@_log:nN {#1} \tl_show:x + \cs_set_eq:NN \@@_log_cmd:e \iow_show:e + \@@_normalize_hook_args:Nn \@@_log:nN {#1} \tl_show:e } } { \cs_new_protected:Npn \hook_show:n #1 { - \cs_set_eq:NN \@@_log_cmd:x \iow_term:x - \@@_normalize_hook_args:Nn \@@_log:nN {#1} \tl_show:x + \cs_set_eq:NN \@@_log_cmd:e \iow_term:e + \@@_normalize_hook_args:Nn \@@_log:nN {#1} \tl_show:e } } -\cs_new_protected:Npn \@@_log_line:x #1 - { \@@_log_cmd:x { >~#1 } } -\cs_new_protected:Npn \@@_log_line_indent:x #1 - { \@@_log_cmd:x { >~\@spaces #1 } } +\cs_new_protected:Npn \@@_log_line:e #1 + { \@@_log_cmd:e { >~#1 } } +\cs_new_protected:Npn \@@_log_line_indent:e #1 + { \@@_log_cmd:e { >~\@spaces #1 } } % \end{macrocode} % % \changes{v1.1a}{2023/04/06} @@ -6216,7 +6207,7 @@ \exp_after:wN \use_none:nnnnnnnnn \use_none:nnnnn } \@@_preamble_hook:n {#1} - \@@_log_cmd:x + \@@_log_cmd:e { ^^J ->~The~ \@@_if_generic:nT {#1} { generic~ } @@ -6237,23 +6228,23 @@ % {Skip mapping over undeclared \cs{g__hook_\meta{hook}_code_prop} (gh/1513)} % \begin{macrocode} \@@_if_usable:nF {#1} - { \@@_log_line:x { The~hook~is~not~declared. } } + { \@@_log_line:e { The~hook~is~not~declared. } } \@@_if_disabled:nT {#1} - { \@@_log_line:x { The~hook~is~disabled. } } + { \@@_log_line:e { The~hook~is~disabled. } } \hook_if_empty:nTF {#1} { #2 { The~hook~is~empty } } { - \@@_log_line:x { Code~chunks: } + \@@_log_line:e { Code~chunks: } \bool_lazy_or:nnTF { ! \prop_if_exist_p:c { g_@@_#1_code_prop } } { \prop_if_empty_p:c { g_@@_#1_code_prop } } - { \@@_log_line_indent:x { --- } } + { \@@_log_line_indent:e { --- } } { \prop_map_inline:cn { g_@@_#1_code_prop } { \exp_after:wN \cs_set:Npn \exp_after:wN \@@_tmp:w \c_@@_nine_parameters_tl {##2} - \@@_log_line_indent:x + \@@_log_line_indent:e { ##1~->~\cs_replacement_spec:N \@@_tmp:w } } } @@ -6261,13 +6252,13 @@ % % If there is code in the |top-level| token list, print it: % \begin{macrocode} - \@@_log_line:x + \@@_log_line:e { Document-level~(top-level)~code \@@_if_usable:nT {#1} { ~(executed~\@@_if_reversed:nTF {#1} {first} {last} ) } : } - \@@_log_line_indent:x + \@@_log_line_indent:e { \@@_cs_if_empty:cTF { @@_toplevel~#1 } { --- } @@ -6276,8 +6267,8 @@ % \end{macrocode} % % \begin{macrocode} - \@@_log_line:x { Extra~code~for~next~invocation: } - \@@_log_line_indent:x + \@@_log_line:e { Extra~code~for~next~invocation: } + \@@_log_line_indent:e { \@@_cs_if_empty:cTF { @@_next~#1 } { --- } @@ -6298,12 +6289,12 @@ % If no rule is there, print |---|. The boolean \cs{l_@@_tmpa_bool} % here indicates if the hook has no rules. % \begin{macrocode} - \@@_log_line:x { Rules: } + \@@_log_line:e { Rules: } \bool_set_true:N \l_@@_tmpa_bool \@@_list_rules:nn {#1} { \bool_set_false:N \l_@@_tmpa_bool - \@@_log_line_indent:x + \@@_log_line_indent:e { ##2~ with~ \str_if_eq:nnT {##3} {??} { default~ } @@ -6311,7 +6302,7 @@ } } \bool_if:NT \l_@@_tmpa_bool - { \@@_log_line_indent:x { --- } } + { \@@_log_line_indent:e { --- } } % \end{macrocode} % % When the hook is declared (that is, the sorting algorithm is applied @@ -6321,7 +6312,7 @@ { \@@_if_usable_p:n {#1} } { ! \hook_if_empty_p:n {#1} } { - \@@_log_line:x + \@@_log_line:e { Execution~order \bool_if:NTF \l_@@_tmpa_bool @@ -6340,7 +6331,7 @@ } } { - \@@_log_line:x { Execution~order: } + \@@_log_line:e { Execution~order: } #2 { \@spaces Not~set~because~the~hook~ \@@_if_usable:nTF {#1} @@ -6363,52 +6354,52 @@ % \exp_after:wN \use_none:nnnnnnnnn \use_none:nnnnn % } % \@@_preamble_hook:n {#1} -% \@@_log_cmd:x +% \@@_log_cmd:e % { ^^J ->~The~ \@@_if_generic:nT % {#1} { generic~ } hook~'#1': } % \@@_if_usable:nF {#1} -% { \@@_log_line:x { The~hook~is~not~declared. } } +% { \@@_log_line:e { The~hook~is~not~declared. } } % \@@_if_disabled:nT {#1} -% { \@@_log_line:x { The~hook~is~disabled. } } +% { \@@_log_line:e { The~hook~is~disabled. } } % \hook_if_empty:nTF {#1} % { #2 { The~hook~is~empty } } % { -% \@@_log_line:x { Code~chunks: } +% \@@_log_line:e { Code~chunks: } % \prop_if_empty:cTF { g_@@_#1_code_prop } -% { \@@_log_line_indent:x { --- } } +% { \@@_log_line_indent:e { --- } } % { % \prop_map_inline:cn { g_@@_#1_code_prop } -% { \@@_log_line_indent:x +% { \@@_log_line_indent:e % { ##1~->~\tl_to_str:n {##2} } } % } -% \@@_log_line:x +% \@@_log_line:e % { % Document-level~(top-level)~code % \@@_if_usable:nT {#1} % { ~(executed~ % \@@_if_reversed:nTF {#1} {first} {last} ) } : % } -% \@@_log_line_indent:x +% \@@_log_line_indent:e % { % \tl_if_empty:cTF { @@_toplevel~#1 } % { --- } % { -> ~ \exp_args:Nv \tl_to_str:n % { @@_toplevel~#1 } } % } -% \@@_log_line:x { Extra~code~for~next~invocation: } -% \@@_log_line_indent:x +% \@@_log_line:e { Extra~code~for~next~invocation: } +% \@@_log_line_indent:e % { % \tl_if_empty:cTF { @@_next~#1 } % { --- } % { ->~ \exp_args:Nv \@@_log_next_code:n % { @@_next~#1 } } % } -% \@@_log_line:x { Rules: } +% \@@_log_line:e { Rules: } % \bool_set_true:N \l_@@_tmpa_bool % \@@_list_rules:nn {#1} % { % \bool_set_false:N \l_@@_tmpa_bool -% \@@_log_line_indent:x +% \@@_log_line_indent:e % { % ##2~ with~ % \str_if_eq:nnT {##3} {??} { default~ } @@ -6416,12 +6407,12 @@ % } % } % \bool_if:NT \l_@@_tmpa_bool -% { \@@_log_line_indent:x { --- } } +% { \@@_log_line_indent:e { --- } } % \bool_lazy_and:nnTF % { \@@_if_usable_p:n {#1} } % { ! \hook_if_empty_p:n {#1} } % { -% \@@_log_line:x +% \@@_log_line:e % { % Execution~order % \bool_if:NTF \l_@@_tmpa_bool @@ -6442,7 +6433,7 @@ % } % } % { -% \@@_log_line:x { Execution~order: } +% \@@_log_line:e { Execution~order: } % #2 % { % \@spaces Not~set~because~the~hook~ @@ -6563,7 +6554,7 @@ { \@@_list_rules:nn {#1} { - \iow_term:x + \iow_term:e { > ##1 {####2} ##1 => ##1 {####1} \str_if_eq:nnT {####3} {??} { ~(default) } @@ -6594,7 +6585,7 @@ % % \changes{v1.1l}{2024/11/26}{Add debugging message (gh/1459)} % \begin{macrocode} - \@@_debug:n{\iow_term:x{[lthooks]~ Add~ to~ + \@@_debug:n{\iow_term:e{[lthooks]~ Add~ to~ \@@_if_usable:nF {#1} { undeclared~ } hook~ '#1'~ ( next~ invocation~ only ) \on@line @@ -6615,7 +6606,7 @@ % % \changes{v1.1l}{2024/11/26}{Add debugging message (gh/1459)} % \begin{macrocode} - \@@_debug:n{\iow_term:x{[lthooks]~ Add~ to~ + \@@_debug:n{\iow_term:e{[lthooks]~ Add~ to~ \@@_if_usable:nF {#1} { undeclared~ } hook~ '#1'~ ( next~ invocation~ only ) \on@line @@ -7778,7 +7769,7 @@ \cs_gset_protected:Npn \@expl@push@filename@aux@@@@ #1#2#3 { \@@_curr_name_push:n {#3} - \str_gset:Nx \g_file_curr_name_str {#3} + \str_gset:Ne \g_file_curr_name_str {#3} #1 #2 {#3} } % \end{macrocode} @@ -8096,7 +8087,7 @@ % } % \cs_set:Npn \@@_tmp:w #1 #2 % { -% \@@_tl_gset:cx { @@#1~#2 } +% \@@_tl_gset:ce { @@#1~#2 } % { % \exp_args:No \exp_not:o % { diff --git a/base/ltkeys.dtx b/base/ltkeys.dtx index 1090446af2..a5a378aceb 100644 --- a/base/ltkeys.dtx +++ b/base/ltkeys.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltkeys.dtx} - [2026-01-16 v1.0q LaTeX Kernel (Keyval options)] + [2026-03-13 v1.0r LaTeX Kernel (Keyval options)] % \iffalse \documentclass{l3in2edoc} \GetFileInfo{ltkeys.dtx} @@ -162,6 +162,9 @@ \ExplSyntaxOn % \end{macrocode} % +% \changes{v1.0r}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} +% % \subsection{Key properties} % % \begin{macro}{.code, .if, .ifnot, .store, .usage} @@ -239,10 +242,11 @@ % % \subsection{Main mechanism} % +% \changes{v1.0r}{2026-03-13}{Tidy up variants} +% % \begin{macrocode} \cs_generate_variant:Nn \clist_if_in:NnT { Ne } \cs_generate_variant:Nn \clist_if_in:NnTF { Ne } -\cs_generate_variant:Nn \clist_put_right:Nn { Nv } % \end{macrocode} % % \begin{macro}{\l_@@_class_only_clist} @@ -331,7 +335,7 @@ { \clist_map_inline:Nn \l_@@_unused_clist { - \msg_error:nnxx { keys } { option-unknown } + \msg_error:nnee { keys } { option-unknown } {##1} { \@currname } } } @@ -568,10 +572,6 @@ % % \subsection{The document interfaces} % -% \begin{macrocode} -\cs_generate_variant:Nn \keys_define:nn { nx } -% \end{macrocode} -% % \begin{macro}{\@@_options_expand_module:Nn} % \changes{v1.0e}{2022/02/21} % {Faster approach to module expansion} @@ -611,7 +611,7 @@ \NewDocumentCommand \DeclareUnknownKeyHandler { O { \@currname } +m } { \cs_set_protected:cpn { @@_unknown_handler_ #1 :nn } ##1##2 {#2} - \@@_options_expand_module:Nn \keys_define:nx {#1} + \@@_options_expand_module:Nn \keys_define:ne {#1} { unknown .code:n = \exp_not:N \exp_args:NV diff --git a/base/ltmarks.dtx b/base/ltmarks.dtx index ed997c3c0e..29703f6445 100644 --- a/base/ltmarks.dtx +++ b/base/ltmarks.dtx @@ -17,7 +17,7 @@ %<*driver> % \fi \ProvidesFile{ltmarks.dtx} - [2026-01-23 v1.1e LaTeX Kernel (Marks)] + [2026-03-23 v1.1f LaTeX Kernel (Marks)] % \iffalse % \documentclass{l3in2edoc} @@ -874,6 +874,9 @@ % {Marks~handling} % \end{macrocode} % +% \changes{v1.1f}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} +% % \subsection{Allocating new mark classes} % % @@ -916,7 +919,7 @@ \cs_new_protected:Npn \@@_new_class:nn #1 { %<*trace> - \@@_debug:n { \iow_term:x { Marks:~new~mark:~#1~\msg_line_context: } } + \@@_debug:n { \iow_term:e { Marks:~new~mark:~#1~\msg_line_context: } } % % \end{macrocode} % Use the \LaTeXe{} interface for now as the L3 programming layer @@ -1183,7 +1186,7 @@ % \begin{macrocode} { %<*trace> - \@@_debug:n { \iow_term:x + \@@_debug:n { \iow_term:e { Marks:~ mark~ extraction~needs~ recursion~ \msg_line_context: } } % @@ -1256,7 +1259,7 @@ % below is fully expanded, so we have to use a lot of % \cs{exp_not:N} commands to prevent expansion where necessary. % \begin{macrocode} -\cs_new_protected:Npx \@@_vbox_set_split_to_maxdimen:NN #1#2 { +\cs_new_protected:Npe \@@_vbox_set_split_to_maxdimen:NN #1#2 { % \end{macrocode} % We start by saving the current interaction and escape char settings. % \begin{macrocode} @@ -1507,7 +1510,7 @@ \tl_if_empty:NTF \g_@@_tmp_tl { %<*trace> - \@@_debug:n { \iow_term:x { Marks:~no~ marks~ + \@@_debug:n { \iow_term:e { Marks:~no~ marks~ for~ class~ '##1'~\msg_line_context: } } % } @@ -1520,7 +1523,7 @@ % \begin{macrocode} { %<*trace> - \@@_debug:n { \iow_term:x { Marks:~ extract~ last~ + \@@_debug:n { \iow_term:e { Marks:~ extract~ last~ % \end{macrocode} % The mark content in \cs{g_@@_tmp_tl} may contain aribtrary code % that may react badly if it is expanded in a write. So we better @@ -1540,7 +1543,7 @@ % faster in case there is none. % \begin{macrocode} %<*trace> - \@@_debug:n { \iow_term:x { + \@@_debug:n { \iow_term:e { Marks:~ extract~ first~ mark~ for~ class~ '##1'~ =~ % \end{macrocode} % Again no expansion for the mark content. @@ -1702,7 +1705,7 @@ \@@_value:nn{ \int_use:N\g_@@_int }{#2} } %<*trace> - \@@_debug:n{ \iow_term:x { Marks:~ set~#1~<-~ + \@@_debug:n{ \iow_term:e { Marks:~ set~#1~<-~ '\tl_to_str:V \g_@@_tmp_tl' ~ \msg_line_context: } } % \tex_marks:D \use:c { c_@@_class_ #1 _mark } @@ -1731,7 +1734,7 @@ % If the mark class was not known, raise an error. % \begin{macrocode} { - \msg_error:nnx { mark } { unknown-class } + \msg_error:nne { mark } { unknown-class } { \tl_to_str:n {#1} } } } @@ -1948,7 +1951,7 @@ } \cs_new_protected:Npn \@@_debug_gset: { - \cs_gset_protected:Npx \@@_debug:n ##1 + \cs_gset_protected:Npe \@@_debug:n ##1 { \bool_if:NT \g_@@_debug_bool {##1} } } % \end{macrocode} diff --git a/base/ltpara.dtx b/base/ltpara.dtx index 277d0d939f..9cf99a9642 100644 --- a/base/ltpara.dtx +++ b/base/ltpara.dtx @@ -17,7 +17,7 @@ %<*driver> % \fi \ProvidesFile{ltpara.dtx} - [2026-01-23 v1.0n LaTeX Kernel (paragraph hooks)] + [2026-03-12 v1.0o LaTeX Kernel (paragraph hooks)] % \iffalse % \documentclass{l3in2edoc} @@ -679,7 +679,8 @@ % {Paragraph~handling~and~hooks} % \end{macrocode} % -% +% \changes{v1.0o}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % % \subsection{Providing hooks for paragraphs} % @@ -929,7 +930,7 @@ % with \cs{everypar} code that attempts to scan ahead to see how % the paragraph text starts. % \begin{macrocode} -\tl_gput_right:Nx \g_@@_standard_everypar_tl { +\tl_gput_right:Ne \g_@@_standard_everypar_tl { \exp_not:N \the \exp_not:N \toks \the \allocationnumber diff --git a/base/ltproperties.dtx b/base/ltproperties.dtx index d5ca6a0162..f4fc99ef4a 100644 --- a/base/ltproperties.dtx +++ b/base/ltproperties.dtx @@ -30,7 +30,7 @@ %<*driver> % \fi \ProvidesFile{ltproperties.dtx} - [2026-01-16 v1.0l LaTeX Kernel (Properties)] + [2026-03-12 v1.0m LaTeX Kernel (Properties)] % \iffalse % \documentclass[full]{l3in2edoc} @@ -481,6 +481,9 @@ % {Cross-referencing~properties} % \end{macrocode} % +% \changes{v1.0m}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} +% % The approach here is based closely on that from \pkg{zref}; separate out % lists of properties and the properties themselves, so the latter can be % used multiple times and in varying combinations. @@ -507,7 +510,7 @@ { \cs_if_free:cTF { @@_code_ #1 : } { - \exp_args:Nx \@@_gset:nnnn { \tl_to_str:n {#1} } + \exp_args:Ne \@@_gset:nnnn { \tl_to_str:n {#1} } {#2} {#3} {#4} } { diff --git a/base/ltshipout.dtx b/base/ltshipout.dtx index 545401414f..0d608b770d 100644 --- a/base/ltshipout.dtx +++ b/base/ltshipout.dtx @@ -34,7 +34,7 @@ %<*driver> % \fi \ProvidesFile{ltshipout.dtx} - [2026-01-23 v1.0p LaTeX Kernel (Shipout)] + [2026-03-12 v1.0q LaTeX Kernel (Shipout)] % \iffalse % \documentclass{l3in2edoc} @@ -683,6 +683,8 @@ \ExplSyntaxOn % \end{macrocode} % +% \changes{v1.0q}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % % \subsection{Debugging} % @@ -711,7 +713,7 @@ } \cs_new_protected:Npn \@@_debug_gset: { - \cs_gset_protected:Npx \@@_debug:n ##1 + \cs_gset_protected:Npe \@@_debug:n ##1 { \bool_if:NT \g_@@_debug_bool {##1} } } % \end{macrocode} @@ -752,7 +754,7 @@ \sys_if_engine_luatex:TF { \newprotectedluacmd \@@_finalize_box: - \exp_args:Nx \everyjob { + \exp_args:Ne \everyjob { \exp_not:V \everyjob \exp_not:N \lua_now:n { luatexbase.create_callback('pre_shipout_filter', 'list') @@ -779,7 +781,7 @@ % documenting that here for now. % \begin{macrocode} \cs_set_protected:Npn \@@_execute: { - \tl_set:Nx \l_@@_group_level_tl + \tl_set:Ne \l_@@_group_level_tl { \int_value:w \tex_currentgrouplevel:D } \tex_afterassignment:D \@@_execute_test_level: \tex_setbox:D \l_shipout_box @@ -1081,7 +1083,7 @@ % instead of the hook code. % \begin{macrocode} \cs_set_protected:Npn \@@_execute_raw: { - \tl_set:Nx \l_@@_group_level_tl + \tl_set:Ne \l_@@_group_level_tl { \int_value:w \tex_currentgrouplevel:D } \tex_afterassignment:D \@@_execute_test_level_raw: \tex_setbox:D \l_@@_raw_box @@ -1374,7 +1376,7 @@ % Save current values of \cs{vfuzz} and \cs{vbadness} then change % them to allow box manipulations without warnings. % \begin{macrocode} - \tl_set:Nx \l_@@_saved_badness_tl + \tl_set:Ne \l_@@_saved_badness_tl { \vfuzz=\the\vfuzz\relax \vbadness=\the\vbadness\relax } \vfuzz=\c_max_dim @@ -1424,7 +1426,7 @@ % \begin{macrocode} \box_if_horizontal:NT \l_shipout_box { - \tl_set:Nx \l_@@_saved_badness_tl + \tl_set:Ne \l_@@_saved_badness_tl { \hfuzz=\the\hfuzz\relax \hbadness=\the\hbadness\relax } \hfuzz=\c_max_dim @@ -1459,7 +1461,7 @@ { \box_if_vertical:NTF \l_shipout_box { - \tl_set:Nx \l_@@_saved_badness_tl + \tl_set:Ne \l_@@_saved_badness_tl { \vfuzz=\the\vfuzz\relax \vbadness=\the\vbadness\relax } \vfuzz=\c_max_dim @@ -1486,7 +1488,7 @@ { \box_if_horizontal:NT \l_shipout_box { - \tl_set:Nx \l_@@_saved_badness_tl + \tl_set:Ne \l_@@_saved_badness_tl { \hfuzz=\the\hfuzz\relax \hbadness=\the\hbadness\relax } \hfuzz=\c_max_dim @@ -1525,12 +1527,12 @@ % \hook{begindocument} hook that affects their setup. % \begin{macrocode} \cs_new:Npn \@@_init_page_origins: { - \tl_const:Nx \c_@@_horigin_tl + \tl_const:Ne \c_@@_horigin_tl { \cs_if_exist_use:NTF \pdfvariable { horigin } { \cs_if_exist_use:NF \pdfhorigin { 1in } } } - \tl_const:Nx \c_@@_vorigin_tl + \tl_const:Ne \c_@@_vorigin_tl { \cs_if_exist_use:NTF \pdfvariable { vorigin } { \cs_if_exist_use:NF \pdfvorigin { 1in } } @@ -1751,7 +1753,7 @@ % \fmi{This needs an interface for \cs{nofiles} in expl3, doesn't at the moment!} % \begin{macrocode} \if@filesw - \iow_now:Nx \@auxout { + \iow_now:Ne \@auxout { \gdef\string\@abspage@last {\int_use:N \g_shipout_readonly_int}} \fi % \end{macrocode} diff --git a/base/ltsockets.dtx b/base/ltsockets.dtx index 4b5f3d1689..3128eea558 100644 --- a/base/ltsockets.dtx +++ b/base/ltsockets.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltsockets.dtx} - [2026-03-10 v0.9c LaTeX Kernel (Sockets)] + [2026-03-12 v0.9d LaTeX Kernel (Sockets)] % \iffalse % \documentclass{l3in2edoc} @@ -744,7 +744,8 @@ % {The~socket~management~system} % \end{macrocode} % -% +% \changes{v0.9d}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % % \subsection{Debugging the socket structures} % @@ -787,11 +788,11 @@ } \cs_new_protected:Npn \@@_debug_gset: { - \cs_gset_protected:Npx \@@_debug:n ##1 + \cs_gset_protected:Npe \@@_debug:n ##1 { \bool_if:NT \g_@@_debug_bool {##1} } - \cs_gset_protected:Npx \@@_debug_term:n ##1 + \cs_gset_protected:Npe \@@_debug_term:n ##1 { \bool_if:NT \g_@@_debug_bool - { \iow_term:x { ^^J [Sockets]~ ==>~ ##1} } } + { \iow_term:e { ^^J [Sockets]~ ==>~ ##1} } } } % \end{macrocode} % \end{macro} diff --git a/base/source2edoc.cls b/base/source2edoc.cls index 90de599192..3fc8cae145 100644 --- a/base/source2edoc.cls +++ b/base/source2edoc.cls @@ -2,7 +2,7 @@ % This class is buggy and needs fixing \ProvidesClass{source2edoc} - [2026-01-16 v0.2f Quick hack to typeset source2.tex + [2026-03-12 v0.2g Quick hack to typeset source2.tex (not usable for anything else and buggy -- will vanish again)!] @@ -43,7 +43,7 @@ \bool_if:NTF \l__codedoc_macro_var_bool {variable} {function} \int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~is~} {s~are~} documented~on~page~ - \exp_args:Nx \pageref { \l__codedoc_tmpa_tl } . + \exp_args:Ne \pageref { \l__codedoc_tmpa_tl } . } } \seq_gclear:N \g__codedoc_nested_names_seq diff --git a/base/testfiles-disabled/lthooks2-007.lvt b/base/testfiles-disabled/lthooks2-007.lvt index 74794e2242..02fb0f38bd 100644 --- a/base/testfiles-disabled/lthooks2-007.lvt +++ b/base/testfiles-disabled/lthooks2-007.lvt @@ -250,7 +250,7 @@ \tl_if_empty:NTF \g__hook_removal_list_tl { \prg_return_false: } { - \exp_args:NNx \tl_if_in:NnTF \g__hook_removal_list_tl + \exp_args:NNe \tl_if_in:NnTF \g__hook_removal_list_tl { \__hook_removal_tl:nn {#1} {#2} } { \prg_return_true: } { \prg_return_false: } } @@ -319,7 +319,7 @@ \tl_if_empty:NTF \g__hook_removal_list_tl { \prg_return_false: } { - \exp_args:NNx \tl_if_in:NnTF \g__hook_removal_list_tl + \exp_args:NNe \tl_if_in:NnTF \g__hook_removal_list_tl { \__hook_removal_tl:nn {#1} {#2} } { \prg_return_true: } { \prg_return_false: } } diff --git a/base/testfiles-ltcmd/ltcmd002.lvt b/base/testfiles-ltcmd/ltcmd002.lvt index e60e21d2ff..dcb557ee96 100644 --- a/base/testfiles-ltcmd/ltcmd002.lvt +++ b/base/testfiles-ltcmd/ltcmd002.lvt @@ -243,13 +243,13 @@ \OMIT\tl_new:N \test \TIMO \TEST{Optional~argument~tests~expand~(expect~T/F/F/F/T)}{ \DeclareDocumentCommand \foo { o m } - { \tl_set:Nx \test { \IfNoValueTF {#1} {TRUE} {FALSE} } + { \tl_set:Ne \test { \IfNoValueTF {#1} {TRUE} {FALSE} } \tl_show:N \test } \foo {bar} \foo [] {bar} \foo [opt]{bar} \DeclareDocumentCommand \foo { s m } - { \tl_set:Nx \test { \IfBooleanTF {#1} {TRUE} {FALSE} } + { \tl_set:Ne \test { \IfBooleanTF {#1} {TRUE} {FALSE} } \tl_show:N \test } \foo {bar} \foo *{bar} diff --git a/base/testfiles-ltcmd/ltcmd003.lvt b/base/testfiles-ltcmd/ltcmd003.lvt index 8828742f69..2130cb2934 100644 --- a/base/testfiles-ltcmd/ltcmd003.lvt +++ b/base/testfiles-ltcmd/ltcmd003.lvt @@ -19,7 +19,7 @@ \ExplSyntaxOn \DeclareDocumentCommand{\foo}{sovm} { - \iow_term:x + \iow_term:e { I~got~'\token_to_str:N\foo \IfBooleanT #1 {*} @@ -64,14 +64,14 @@ % \TIMO % \DeclareDocumentCommand{\foo}{ o +v g +v m } % #5 just used for cleanup % { -% \tl_set:Nx \l_tmpa_tl +% \tl_set:Ne \l_tmpa_tl % { % I've~got~\iow_char:N\\foo % \IfValueT {#1} { \tl_to_str:n { [#1] } } -#2- % \IfValueT {#3} { \tl_to_str:n { {#3} } } -#4- % } -% \tl_replace_all:Nxx \l_tmpa_tl { \iow_char:N\^^M } { \iow_newline: } -% \iow_term:x { \tl_to_str:N \l_tmpa_tl } +% \tl_replace_all:Nee \l_tmpa_tl { \iow_char:N\^^M } { \iow_newline: } +% \iow_term:e { \tl_to_str:N \l_tmpa_tl } % } % \ExplSyntaxOff % \foo[x]& diff --git a/base/testfiles-ltcmd/ltcmd004.lvt b/base/testfiles-ltcmd/ltcmd004.lvt index b04effeba1..78320d99f7 100644 --- a/base/testfiles-ltcmd/ltcmd004.lvt +++ b/base/testfiles-ltcmd/ltcmd004.lvt @@ -387,7 +387,7 @@ \TEST { Two~processors } { - \cs_new_protected:Npn \CountArg #1 { \tl_set:Nx \ProcessedArgument { \tl_count:n {#1} } } + \cs_new_protected:Npn \CountArg #1 { \tl_set:Ne \ProcessedArgument { \tl_count:n {#1} } } \DeclareDocumentCommand { \foo } { >{\CountArg} >{\SplitList{,}} m >{\SplitList{,}} >{\CountArg} m } { \TYPE { \tl_to_str:n { |#1|#2| } } } \foo { a , bcd } { a , bcd } diff --git a/base/testfiles-ltcmd/ltcmd005.lvt b/base/testfiles-ltcmd/ltcmd005.lvt index 94c79952b3..dfa487cdab 100644 --- a/base/testfiles-ltcmd/ltcmd005.lvt +++ b/base/testfiles-ltcmd/ltcmd005.lvt @@ -44,14 +44,14 @@ \testA {a} ~ [b] \q_stop \testA {a} [b] ~ \c_space_token \q_stop \testA {a} [b] \c_space_token [d] \q_stop - \use:x { \testA {a} [b] ~ \c_space_tl [c[d]] ~ \c_space_token } \q_stop + \use:e { \testA {a} [b] ~ \c_space_tl [c[d]] ~ \c_space_token } \q_stop \NewDocumentCommand { \testB } { m ! + s s } { \test:nw { #1 | #2 | #3 } } \testB \par \use_none:nn \ERROR \q_stop \testB {a} ~ * \q_stop \testB {a} * ~ \c_space_token \q_stop \testB {a} * \c_space_token * \q_stop - \use:x { \testB {a} * ~ \c_space_tl * ~ \c_space_token } \q_stop + \use:e { \testB {a} * ~ \c_space_tl * ~ \c_space_token } \q_stop } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/base/testfiles-lthooks/filehook-008.lvt b/base/testfiles-lthooks/filehook-008.lvt index f9ce5945dc..f4d31c4470 100644 --- a/base/testfiles-lthooks/filehook-008.lvt +++ b/base/testfiles-lthooks/filehook-008.lvt @@ -9,7 +9,7 @@ \int_step_inline:nn {10} { \iow_open:Nn \l_tmpa_iow { \int_to_alph:n {#1}.tex } - \iow_now:Nx \l_tmpa_iow + \iow_now:Ne \l_tmpa_iow { \exp_not:N \typeout { >>~\int_to_Alph:n {#1}~<< } } \iow_close:N \l_tmpa_iow } diff --git a/base/testfiles-lthooks/lthooks-012.lvt b/base/testfiles-lthooks/lthooks-012.lvt index d8eb1b6b8a..e0814308c3 100644 --- a/base/testfiles-lthooks/lthooks-012.lvt +++ b/base/testfiles-lthooks/lthooks-012.lvt @@ -26,11 +26,11 @@ \int_while_do:nNnn \l_test_int < {2000} { - \exp_args:Nx\hook_new:n{\int_use:N\l_test_int} + \exp_args:Ne\hook_new:n{\int_use:N\l_test_int} \int_set:Nn\l_testii_int{1} \int_while_do:nNnn \l_testii_int < {3} { - \exp_args:Nxx\hook_gput_code:nnn{\int_use:N\l_test_int} + \exp_args:Nee\hook_gput_code:nnn{\int_use:N\l_test_int} {\int_use:N\l_testii_int xx} {\typeout{\int_use:N\l_testii_int}} \int_incr:N\l_testii_int diff --git a/base/testfiles/github-0479-often.luatex.tlg b/base/testfiles/github-0479-often.luatex.tlg index eabc0a5991..3b11eaf045 100644 --- a/base/testfiles/github-0479-often.luatex.tlg +++ b/base/testfiles/github-0479-often.luatex.tlg @@ -976,13 +976,13 @@ l. ...\show \__kernel_chk_if_free_cs:N > \e@alloc=macro: #1#2#3#4#5#6->\global \advance #3\@ne \e@ch@ck {#3}{#4}{#5}#1\allocationnumber #3\relax \global #2#6\allocationnumber \wlog {\string #6=\string #1\the \allocationnumber }. l. ...\show \e@alloc -> \__kernel_msg_error:nne=undefined. +> \__kernel_msg_error:nne=\relax. l. ...\show \__kernel_msg_error:nne > \msg_new:nnnn=\protected\long macro: #1#2#3#4->\__msg_chk_free:nn {#1}{#2}\cs_gset:cpn {\c__msg_text_prefix_tl #1/#2}##1##2##3##4{#3}\cs_gset:cpn {\c__msg_more_text_prefix_tl #1/#2}##1##2##3##4{#4}. l. ...\show \msg_new:nnnn > \NewDocumentCommand=\protected\long macro: -#1#2#3->\__cmd_check_definable:nNT {#1}\NewDocumentCommand {\cs_if_exist:NTF #1{\msg_error:nnxx {cmd}{already-defined}{\use:nnn \token_to_str:N #1{}}{\token_to_str:N \NewDocumentCommand }}{\__cmd_declare_cmd:Nnn #1{#2}{#3}}}. +#1#2#3->\__cmd_check_definable:nNT {#1}\NewDocumentCommand {\cs_if_exist:NTF #1{\msg_error:nnee {cmd}{already-defined}{\use:nnn \token_to_str:N #1{}}{\token_to_str:N \NewDocumentCommand }}{\__cmd_declare_cmd:Nnn #1{#2}{#3}}}. l. ...\show \NewDocumentCommand > \newcommand=macro: ->\@star@or@long \new@command . diff --git a/base/testfiles/github-0479-often.tlg b/base/testfiles/github-0479-often.tlg index b94e618a2a..aa24573762 100644 --- a/base/testfiles/github-0479-often.tlg +++ b/base/testfiles/github-0479-often.tlg @@ -1401,13 +1401,13 @@ l. ...\show \__kernel_chk_if_free_cs:N > \e@alloc=macro: #1#2#3#4#5#6->\global \advance #3\@ne \e@ch@ck {#3}{#4}{#5}#1\allocationnumber #3\relax \global #2#6\allocationnumber \wlog {\string #6=\string #1\the \allocationnumber }. l. ...\show \e@alloc -> \__kernel_msg_error:nne=undefined. +> \__kernel_msg_error:nne=\relax. l. ...\show \__kernel_msg_error:nne > \msg_new:nnnn=\protected\long macro: #1#2#3#4->\__msg_chk_free:nn {#1}{#2}\cs_gset:cpn {\c__msg_text_prefix_tl #1/#2}##1##2##3##4{#3}\cs_gset:cpn {\c__msg_more_text_prefix_tl #1/#2}##1##2##3##4{#4}. l. ...\show \msg_new:nnnn > \NewDocumentCommand=\protected\long macro: -#1#2#3->\__cmd_check_definable:nNT {#1}\NewDocumentCommand {\cs_if_exist:NTF #1{\msg_error:nnxx {cmd}{already-defined}{\use:nnn \token_to_str:N #1{}}{\token_to_str:N \NewDocumentCommand }}{\__cmd_declare_cmd:Nnn #1{#2}{#3}}}. +#1#2#3->\__cmd_check_definable:nNT {#1}\NewDocumentCommand {\cs_if_exist:NTF #1{\msg_error:nnee {cmd}{already-defined}{\use:nnn \token_to_str:N #1{}}{\token_to_str:N \NewDocumentCommand }}{\__cmd_declare_cmd:Nnn #1{#2}{#3}}}. l. ...\show \NewDocumentCommand > \newcommand=macro: ->\@star@or@long \new@command . diff --git a/base/testfiles/github-0479-often.xetex.tlg b/base/testfiles/github-0479-often.xetex.tlg index a4dac6f55e..ce7fea363a 100644 --- a/base/testfiles/github-0479-often.xetex.tlg +++ b/base/testfiles/github-0479-often.xetex.tlg @@ -973,13 +973,13 @@ l. ...\show \__kernel_chk_if_free_cs:N > \e@alloc=macro: #1#2#3#4#5#6->\global \advance #3\@ne \e@ch@ck {#3}{#4}{#5}#1\allocationnumber #3\relax \global #2#6\allocationnumber \wlog {\string #6=\string #1\the \allocationnumber }. l. ...\show \e@alloc -> \__kernel_msg_error:nne=undefined. +> \__kernel_msg_error:nne=\relax. l. ...\show \__kernel_msg_error:nne > \msg_new:nnnn=\protected\long macro: #1#2#3#4->\__msg_chk_free:nn {#1}{#2}\cs_gset:cpn {\c__msg_text_prefix_tl #1/#2}##1##2##3##4{#3}\cs_gset:cpn {\c__msg_more_text_prefix_tl #1/#2}##1##2##3##4{#4}. l. ...\show \msg_new:nnnn > \NewDocumentCommand=\protected\long macro: -#1#2#3->\__cmd_check_definable:nNT {#1}\NewDocumentCommand {\cs_if_exist:NTF #1{\msg_error:nnxx {cmd}{already-defined}{\use:nnn \token_to_str:N #1{}}{\token_to_str:N \NewDocumentCommand }}{\__cmd_declare_cmd:Nnn #1{#2}{#3}}}. +#1#2#3->\__cmd_check_definable:nNT {#1}\NewDocumentCommand {\cs_if_exist:NTF #1{\msg_error:nnee {cmd}{already-defined}{\use:nnn \token_to_str:N #1{}}{\token_to_str:N \NewDocumentCommand }}{\__cmd_declare_cmd:Nnn #1{#2}{#3}}}. l. ...\show \NewDocumentCommand > \newcommand=macro: ->\@star@or@long \new@command . diff --git a/base/testfiles/m3expl009.lvt b/base/testfiles/m3expl009.lvt index ea35f650a2..f938fcc8c8 100644 --- a/base/testfiles/m3expl009.lvt +++ b/base/testfiles/m3expl009.lvt @@ -27,7 +27,7 @@ \RequirePackage{expl3} \group_end: } -\str_set:Nx \c_sys_engine_exec_str { zzzz } +\str_set:Ne \c_sys_engine_exec_str { zzzz } \ExplSyntaxOff % If the version of expl3 preloaded in the kernel differs diff --git a/required/firstaid/changes.txt b/required/firstaid/changes.txt index 976acf136a..33328f6e8b 100644 --- a/required/firstaid/changes.txt +++ b/required/firstaid/changes.txt @@ -1,3 +1,7 @@ +2026-03-12 Joseph Wright + * latex2e-first-aid-for-external-files.dtx: + Switch from x- to e-type expansion in expl3 code + 2026-01-18 Joseph Wright * latex2e-first-aid-for-external-files.dtx (subsection{The \pkg{arydshln} package first aid}): diff --git a/required/firstaid/latex2e-first-aid-for-external-files.dtx b/required/firstaid/latex2e-first-aid-for-external-files.dtx index fe31b391d5..7d1605f76a 100644 --- a/required/firstaid/latex2e-first-aid-for-external-files.dtx +++ b/required/firstaid/latex2e-first-aid-for-external-files.dtx @@ -112,8 +112,8 @@ % \end{macrocode} % % \begin{macrocode} -\def\LaTeXFirstAidDate{2026/02/24} -\def\LaTeXFirstAidVersion{v1.1w} +\def\LaTeXFirstAidDate{2026-03-12} +\def\LaTeXFirstAidVersion{v1.1x} % \end{macrocode} % % \begin{macrocode} @@ -122,6 +122,8 @@ LaTeX kernel fixes to external files and packages] % \end{macrocode} % +% \changes{v1.1x}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % % \begin{macro}{\FirstAidNeededT} % This is a very simple help to ensure that we only apply first aid @@ -135,7 +137,7 @@ % \begin{macrocode} \ExplSyntaxOn \cs_new:Npn\FirstAidNeededT#1#2#3{ - \exp_args:Ncx\str_if_eq:onTF{ver@#1.#2}{#3} + \exp_args:Nce\str_if_eq:onTF{ver@#1.#2}{#3} { \typeout{==>~ First~ Aid~ for~ #1.#2~ applied! } } { \typeout{==>~ First~ Aid~ for~ #1.#2~ no~ longer~ applied!^^J \@spaces Expected:^^J @@ -144,7 +146,7 @@ \@spaces\@spaces \use:c{ver@#1.#2}^^J \@spaces so~ I'm~ assuming~ it~ got~ fixed. } } - \exp_args:Ncx\str_if_eq:onT{ver@#1.#2}{#3} + \exp_args:Nce\str_if_eq:onT{ver@#1.#2}{#3} } \ExplSyntaxOff % \end{macrocode} diff --git a/required/latex-lab/changes.txt b/required/latex-lab/changes.txt index 21a9fe0afc..6ea91eb832 100644 --- a/required/latex-lab/changes.txt +++ b/required/latex-lab/changes.txt @@ -3,6 +3,10 @@ * latex-lab-block.dtx (subsubsection{Handling \tn{par} after the end of the list}): Restore \par first before attempting to add a \skip_vertical:n (tagging/1298) +2026-03-12 Joseph Wright + * latex-lab-block.dtx, latex-lab-context.dtx, latex-lab-firstaid.dtx, + latex-lab-sec-template.dtx: Switch from x- to e-type expansion in expl3 code + 2026-02-25 Ulrike Fischer * latex-lab-sec-template.dtx: remove glyphtounicode definition, is in the kernel now diff --git a/required/latex-lab/footref-tagging-approach.tex b/required/latex-lab/footref-tagging-approach.tex index 54834bdba1..2c75df0b69 100644 --- a/required/latex-lab/footref-tagging-approach.tex +++ b/required/latex-lab/footref-tagging-approach.tex @@ -37,7 +37,7 @@ \tag_if_loaded:TF { \tag_mc_end_push: - \exp_args:Nx + \exp_args:Ne \tag_struct_begin:n{tag=Lbl,ref=fn.\__tag_FEMARK_id_tl} \tag_mc_begin:n{tag=Lbl} \IfPackageLoadedTF{hyperref}{ \hyper@linkstart diff --git a/required/latex-lab/latex-lab-block.dtx b/required/latex-lab/latex-lab-block.dtx index 5c3c430ef0..cd2f988efd 100644 --- a/required/latex-lab/latex-lab-block.dtx +++ b/required/latex-lab/latex-lab-block.dtx @@ -75,7 +75,8 @@ % % \begin{documentation} % -% +% \changes{v0.9p}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % % \section{Introduction} % @@ -3042,11 +3043,11 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_debug_gset: { - \cs_gset_protected:Npx \@@_debug:n ##1 + \cs_gset_protected:Npe \@@_debug:n ##1 { \bool_if:NT \g_@@_debug_bool {##1} } - \cs_gset_protected:Npx \@@_debug_typeout:n ##1 + \cs_gset_protected:Npe \@@_debug_typeout:n ##1 { \bool_if:NT \g_@@_debug_bool - { \iow_term:x { ^^J [Blocks]~ ==>~ ##1} } } + { \iow_term:e { ^^J [Blocks]~ ==>~ ##1} } } } % \end{macrocode} % \end{macro} diff --git a/required/latex-lab/latex-lab-context.dtx b/required/latex-lab/latex-lab-context.dtx index dbb7888c47..5dc194aae3 100644 --- a/required/latex-lab/latex-lab-context.dtx +++ b/required/latex-lab/latex-lab-context.dtx @@ -15,8 +15,8 @@ % % https://github.com/latex3/latex2e/issues % -\def\ltlabcontextdate{2026-01-16} -\def\ltlabcontextversion{0.5b} +\def\ltlabcontextdate{2026-02-12} +\def\ltlabcontextversion{0.5c} %<*driver> \DocumentMetadata{tagging=on,pdfstandard=ua-2,lang=en} \documentclass{l3in2edoc} @@ -403,6 +403,9 @@ %<@@=context> % \end{macrocode} % +% \changes{v0.5c}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} +% % \begin{macrocode} \RequirePackage{latex-lab-testphase-block} % \end{macrocode} @@ -451,9 +454,9 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_debug_gset: { - \cs_gset_protected:Npx \@@_debug:n ##1 + \cs_gset_protected:Npe \@@_debug:n ##1 { \bool_if:NT \g_@@_debug_bool {##1} } - \cs_gset_protected:Npx \@@_debug_typeout:n ##1 + \cs_gset_protected:Npe \@@_debug_typeout:n ##1 { \bool_if:NT \g_@@_debug_bool { \typeout{[Context]~ ==>~ ##1} } } } % \end{macrocode} @@ -776,9 +779,9 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_debug_gset: { - \cs_gset_protected:Npx \@@_debug:n ##1 + \cs_gset_protected:Npe \@@_debug:n ##1 { \bool_if:NT \g_@@_debug_bool {##1} } - \cs_gset_protected:Npx \@@_debug_typeout:n ##1 + \cs_gset_protected:Npe \@@_debug_typeout:n ##1 { \bool_if:NT \g_@@_debug_bool { \typeout{[Template]~ ==>~ ##1} } } } % \end{macrocode} diff --git a/required/latex-lab/latex-lab-firstaid.dtx b/required/latex-lab/latex-lab-firstaid.dtx index ccee966f74..9408412227 100644 --- a/required/latex-lab/latex-lab-firstaid.dtx +++ b/required/latex-lab/latex-lab-firstaid.dtx @@ -15,8 +15,8 @@ % % https://github.com/latex3/latex2e/issues % -\def\ltlabfirstaiddate{2026-01-19} -\def\ltlabfirstaidversion{0.85s} +\def\ltlabfirstaiddate{2026-02-12} +\def\ltlabfirstaidversion{0.85t} %<*driver> \DocumentMetadata{tagging=on,pdfstandard=ua-2} @@ -60,6 +60,8 @@ % No longer needed with new \cs{@doendpe} code.} % \changes{v0.85g}{2024/10/04}{Added firstaid for fancyvrb.} % \changes{v0.85n}{2025-10-12}{Added firstaid for pgf.} +% \changes{v0.85t}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} % \section{Implementation} % % \begin{macrocode} @@ -83,7 +85,7 @@ % \begin{macrocode} \ExplSyntaxOn \providecommand\FirstAidNeededT[3]{ - \exp_args:Ncx\str_if_eq:onF{ver@#1.#2}{#3} + \exp_args:Nce\str_if_eq:onF{ver@#1.#2}{#3} { \typeout{==>~ First~ Aid~ for~ #1.#2~ no~ longer~ applied!^^J \@spaces Expected:^^J \@spaces\@spaces #3^^J @@ -91,7 +93,7 @@ \@spaces\@spaces \use:c{ver@#1.#2}^^J \@spaces so~ I'm~ assuming~ it~ got~ fixed. } } - \exp_args:Ncx\str_if_eq:onT{ver@#1.#2}{#3} + \exp_args:Nce\str_if_eq:onT{ver@#1.#2}{#3} } % \end{macrocode} % \end{macro} diff --git a/required/latex-lab/latex-lab-sec-template.dtx b/required/latex-lab/latex-lab-sec-template.dtx index 2c82d3c457..617f63fe10 100644 --- a/required/latex-lab/latex-lab-sec-template.dtx +++ b/required/latex-lab/latex-lab-sec-template.dtx @@ -17,8 +17,8 @@ % % https://github.com/latex3/latex2e/issues % -\def\ltlabsecIIdate{2026-01-26} -\def\ltlabsecIIversion{0.9b} +\def\ltlabsecIIdate{2026-03-12} +\def\ltlabsecIIversion{0.9c} %<*driver> \DocumentMetadata{tagging=on,pdfstandard=ua-2,testphase=sec-template} @@ -1033,6 +1033,9 @@ {heading implementation} % \end{macrocode} % +% \changes{v0.9c}{2026-03-12}{Switch from \texttt{x}- to \texttt{e}-type +% expansion in expl3 code} +% % \bigskip % % \subsection{Debugging} @@ -1074,9 +1077,9 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_debug_gset: { - \cs_gset_protected:Npx \@@_debug:n ##1 + \cs_gset_protected:Npe \@@_debug:n ##1 { \bool_if:NT \g_@@_debug_bool {##1} } - \cs_gset_protected:Npx \@@_debug_typeout:n ##1 + \cs_gset_protected:Npe \@@_debug_typeout:n ##1 { \bool_if:NT \g_@@_debug_bool { \typeout{[head]~ ##1} } } } % \end{macrocode} diff --git a/required/latex-lab/latex-lab-title.dtx b/required/latex-lab/latex-lab-title.dtx index 239561f89c..29fc01f990 100644 --- a/required/latex-lab/latex-lab-title.dtx +++ b/required/latex-lab/latex-lab-title.dtx @@ -365,7 +365,6 @@ % \begin{macrocode} \regex_new:N\l_@@_title_optlang_regex \regex_set:Nn\l_@@_title_optlang_regex {\A\[([A-Za-z\-]+)\](.*)} -\cs_generate_variant:Nn \regex_extract_once:NnN{NVN} \cs_generate_variant:Nn \clist_item:nn {on} % \end{macrocode} % and now the keys.