[latex3-commits] [git/LaTeX3-latex3-latex2e] gh239: Correctly detect composites (55a9bef7)
PhelypeOleinik
tex.phelype at gmail.com
Thu Jun 11 17:48:57 CEST 2020
Repository : https://github.com/latex3/latex2e
On branch : gh239
Link : https://github.com/latex3/latex2e/commit/55a9bef7801151e5929ca11332aa3c46d921c5da
>---------------------------------------------------------------
commit 55a9bef7801151e5929ca11332aa3c46d921c5da
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date: Thu Jun 11 12:48:57 2020 -0300
Correctly detect composites
Different encodings have different definitions for the error argument
>---------------------------------------------------------------
55a9bef7801151e5929ca11332aa3c46d921c5da
base/ltoutenc.dtx | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/base/ltoutenc.dtx b/base/ltoutenc.dtx
index d95cfe99..18662841 100644
--- a/base/ltoutenc.dtx
+++ b/base/ltoutenc.dtx
@@ -1407,18 +1407,28 @@
% name, so it isn't a \emph{full} copy.
% \begin{macrocode}
\def\@if at text@composite at copy@else#1#2#3#4{%
- \edef\reserved at a##1{%
- \noexpand\@text at composite \noexpand#2##1\noexpand\@empty
- \noexpand\@text at composite
- {\noexpand\@latex at error
- {\noexpand\string\noexpand#3 undeclared in encoding #4}%
- \noexpand\@eha{##1}}}
- \ifx\reserved at a#2%
- \@latex at error{Composites cannot be copied yet.}\@eha
- \expandafter\@firstofone
- \else
- \expandafter\@firstofone
- \fi}
+ \begingroup
+ \escapechar=`\\
+ \edef\x{\endgroup
+ \def\noexpand\reserved at a####1\detokenize{%
+ macro:}\string##1->%
+ \detokenize{\@text at composite#2}\string##1\detokenize{\@empty
+ \@text at composite}####2\noexpand\@nil{%
+ \noexpand\ifx\relax####1\unexpanded{%
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi}}%
+ \noexpand\reserved at a\meaning#2\detokenize{%
+ macro:}\string##1->%
+ \detokenize{\@text at composite#2}\string##1\detokenize{\@empty
+ \@text at composite}{\relax}\noexpand\@nil
+ }\x
+ {\@latex at error{Composites cannot be copied yet}\@eha%
+ \@firstofone
+ % \@copy at text@composite
+ }%
+ {\@firstofone}}
% \end{macrocode}
%
% Here's the \cs{@copy at declaretextcommand@enc} auxiliary:
More information about the latex3-commits
mailing list.