[latex3-commits] [git/LaTeX3-latex3-latex3] master: Allow for fact \cpd at list exists for LaTeX2e only (4e6da06e7)
Joseph Wright
joseph.wright at morningstar2.co.uk
Mon Feb 10 18:15:58 CET 2020
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/4e6da06e751e1468ff3eced1c375ceab0fb2569f
>---------------------------------------------------------------
commit 4e6da06e751e1468ff3eced1c375ceab0fb2569f
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon Feb 10 17:15:58 2020 +0000
Allow for fact \cpd at list exists for LaTeX2e only
>---------------------------------------------------------------
4e6da06e751e1468ff3eced1c375ceab0fb2569f
l3kernel/l3text.dtx | 66 ++++++++++++++++++++++++++---------------------------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index c63f4d040..40f677f87 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -844,16 +844,15 @@
% the \cs{protect} might be explicit, in which case we need to leave it alone
% if it's required.
% \begin{macrocode}
-\cs_new:Npn \@@_expand_cs:N #1
+\cs_new:Npx \@@_expand_cs:N #1
{
- \str_if_eq:nnTF {#1} { \protect }
- { \@@_expand_protect:N }
-%<*initex>
- { \@@_expand_expand:N #1 }
-%</initex>
-%<*package>
- { \@@_expand_encoding:N #1 }
-%</package>
+ \exp_not:N \str_if_eq:nnTF {#1} { \exp_not:N \protect }
+ { \exp_not:N \@@_expand_protect:N }
+ {
+ \cs_if_exist:NTF \cdp at list
+ { \exp_not:N \@@_expand_encoding:N #1 }
+ { \exp_not:N \@@_expand_expand:N #1 }
+ }
}
\cs_new:Npn \@@_expand_protect:N #1
{
@@ -877,38 +876,39 @@
% Deal with encoding-specific commands in package mode: at the end of
% the preamble, we tidy up as the data otherwise vanishes.
% \begin{macrocode}
-%<*package>
-\cs_new:Npn \@@_expand_encoding:N #1
+\cs_if_exist:NT \cdp at list
{
- \exp_after:wN \@@_expand_encoding:NNnnnn \exp_after:wN #1
- \cdp at elt \q_recursion_tail { } { } { } { } \q_recursion_stop
- }
-\cs_new:Npn \@@_expand_encoding:NNnnnn #1#2#3#4#5#6
- {
- \quark_if_recursion_tail_stop_do:Nn #2 { \@@_expand_replace:N #1 }
- \str_if_eq:eeTF { \exp_not:N #1 } { \exp_not:c { #3 - cmd } }
+ \cs_new:Npn \@@_expand_encoding:N #1
{
- \use_i_delimit_by_q_recursion_stop:nw
- { \@@_expand_loop:w \@@_expand_textcomp:NN #1 }
+ \exp_after:wN \@@_expand_encoding:NNnnnn \exp_after:wN #1
+ \cdp at elt \q_recursion_tail { } { } { } { } \q_recursion_stop
}
- { \@@_expand_encoding:NNnnnn #1 }
- }
-\AtBeginDocument
- {
- \cs_set:Npn \@@_expand_cs:N #1
+ \cs_new:Npn \@@_expand_encoding:NNnnnn #1#2#3#4#5#6
{
- \str_if_eq:nnTF {#1} { \protect }
- { \@@_expand_protect:N }
- { \@@_expand_replace:N #1 }
+ \quark_if_recursion_tail_stop_do:Nn #2 { \@@_expand_replace:N #1 }
+ \str_if_eq:eeTF { \exp_not:N #1 } { \exp_not:c { #3 - cmd } }
+ {
+ \use_i_delimit_by_q_recursion_stop:nw
+ { \@@_expand_loop:w \@@_expand_textcomp:NN #1 }
+ }
+ { \@@_expand_encoding:NNnnnn #1 }
}
- \cs_set_protected:Npn \cdp at elt #1#2#3#4
+ \AtBeginDocument
{
- \text_declare_expand_equivalent:cn { #1 -cmd }
- { \@@_expand_textcomp:NN }
+ \cs_set:Npn \@@_expand_cs:N #1
+ {
+ \str_if_eq:nnTF {#1} { \protect }
+ { \@@_expand_protect:N }
+ { \@@_expand_replace:N #1 }
+ }
+ \cs_set_protected:Npn \cdp at elt #1#2#3#4
+ {
+ \text_declare_expand_equivalent:cn { #1 -cmd }
+ { \@@_expand_textcomp:NN }
+ }
+ \cdp at list
}
- \cdp at list
}
-%</package>
% \end{macrocode}
% See if there is a dedicated replacement, and if there is, insert it.
% \begin{macrocode}
More information about the latex3-commits
mailing list.