[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Gh253 (#728) (e2a16f21)

GitHub noreply at github.com
Wed Dec 15 23:44:58 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/e2a16f218d9e7158da6156951c5007eaaa2a91f7

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

commit e2a16f218d9e7158da6156951c5007eaaa2a91f7
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed Dec 15 23:44:58 2021 +0100

    Gh253 (#728)
    
    * implementation for #253
    
    * move description out of ltnews34
    
    * move doc into ltnews35
    
    * change log and some rewording
    
    * forgot to add \DeclareUnicodeCommand and Symbol


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

e2a16f218d9e7158da6156951c5007eaaa2a91f7
 base/changes.txt                  |   7 +
 base/doc/ltnews35.tex             |  30 +++-
 base/ltoutenc.dtx                 | 370 +++++++++++++++++++++-----------------
 base/testfiles-TU/github-0253.lvt |  31 ++++
 base/testfiles-TU/github-0253.tlg |  26 +++
 5 files changed, 295 insertions(+), 169 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index f49223dd..b98cb501 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -10,6 +10,13 @@ are not part of the distribution.
 
 	* utf8ienc.dtx:  Use hex 80 not A0 to test for single byte UTF-8 github/730
 
+2021-12-12  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltoutenc.dtx (subsection{Definitions for the TU encoding}):
+	\DeclareUnicodeAccent now makes the encoding argument implicit
+	as it is already done for other Unicode encoding commands.
+	Also added \DeclareUnicodeCommand and \DeclareUnicodeSymbol (gh/253).
+
 2021-12-12  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* doc.dtx (subsection[Dealing with the change history]):
diff --git a/base/doc/ltnews35.tex b/base/doc/ltnews35.tex
index 96611b4d..afe9fc50 100644
--- a/base/doc/ltnews35.tex
+++ b/base/doc/ltnews35.tex
@@ -261,6 +261,7 @@ engine. This simplifies the handling of these callbacks and makes it
 easier to provide consistent interfaces for user defined \texttt{list}
 callbacks.
 
+
 \subsection{Class \class{proc} supports \option{twoside}}
 
 The document class \class{proc}, which is a small variation on the
@@ -271,7 +272,7 @@ displaying different data in the footer line on recto and verso pages.
 
 
 \subsection{Croatian character support}
-%
+
 The default \pkg{inputenc} support has been extended to support the 9 characters
 D\v Z, D\v z, d\v z, LJ, Lj, lj, NJ, Nj, nj, input as single UTF-8 codepoints
 in the range U+01C4 to U+01CC.
@@ -279,6 +280,33 @@ in the range U+01C4 to U+01CC.
 \githubissue{gh/723}
 
 
+\subsection{Cleanup of the Unicode declaration interface}
+
+When declaring encoding specific commands for the Unicode (TU)
+encoding some declarations (e.g., \cs{DeclareUnicodeComposite}) do not
+have an explicit argument for the the encoding name, but instead use
+the command \cs{UnicodeEncodingName} internally. There was one
+exception though: \cs{DeclareUnicodeAccent} required an explicit
+encoding argument.  This inconsistency has now been removed and the
+encoding name is always implicit. To avoid a breaking change for a few
+packages on CTAN \cs{DeclareUnicodeAccent} still accepts three
+arguments if the second argument is \texttt{TU} or
+\cs{UnicodeEncodingName}. Once all packages have been updated this
+code branch will get removed.
+
+At the same time we added \cs{DeclareUnicodeCommand} and
+\cs{DeclareUnicodeSymbol} for consistency. They also use
+\cs{UnincodeEncodingName} internally, instead of requiring an encoding
+argument as their general purpose counterparts do.
+%
+\githubissue{253}
+
+
+
+\subsection{???}
+%
+\githubissue{???}
+
 
 \section{Bug fixes}
 
diff --git a/base/ltoutenc.dtx b/base/ltoutenc.dtx
index 8d034332..b83907fc 100644
--- a/base/ltoutenc.dtx
+++ b/base/ltoutenc.dtx
@@ -44,7 +44,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltoutenc.dtx}
-             [2021/10/16 v2.0x LaTeX Kernel (font encodings)]
+             [2021/12/12 v2.0y LaTeX Kernel (font encodings)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltoutenc.dtx}
@@ -3017,8 +3017,33 @@
   \char#1\relax}
 %    \end{macrocode}
 %
-%    \begin{macrocode}
-\def\DeclareUnicodeAccent#1#2#3{%
+%    In its original implementation \cs{DeclareUnicodeAccent} was
+%    given 3 arguments (with second the ``Unicode encoding'' a.k.a.,
+%    \cs{UnicodeEncodingName}) while in other places, e.g.,
+%    \cs{DeclareUnicodeComposite}, we always made encoding implicit. So
+%    we now change it here to implicit too so that the interfaces
+%    become a bit more consistent. To avoid making that a
+%    breaking change (even though it only affects two packages on
+%    CTAN) we test for \verb=#2= being \cs{UnicodeEncodingName}. This
+%    would not catch if somebody used
+%    \verb|\DeclareUnicodeAccent{\=}{TU-sub}{"0304}|
+%    but that fortunately hasn't happened. With the implicit argument
+%    you would need to change \cs{UnicodeEncodingName} instead, as you
+%    have to do anyway for the other interface commands.
+% \changes{v2.0y}{2021/12/12}{\cs{DeclareUnicodeAccent} now makes the
+%                             encoding argument implicit (gh/253)}
+%    \begin{macrocode}
+\def\DeclareUnicodeAccent#1#2{%
+  \edef\reserved at a{#2}%
+  \edef\reserved at b{\UnicodeEncodingName}%
+  \ifx\reserved at a\reserved at b
+    \def\reserved at a{\DeclareUnicodeAccent@{#1}}%
+  \else
+    \def\reserved at a{\DeclareUnicodeAccent@{#1}\UnicodeEncodingName}%
+  \fi
+  \reserved at a{#2}%
+}  
+\def\DeclareUnicodeAccent@#1#2#3{%
   \DeclareTextCommand{#1}{#2}{\add at unicode@accent{#3}}%
 }
 %    \end{macrocode}
@@ -3059,113 +3084,119 @@
   \def\reserved at b{#1#2}}
 %    \end{macrocode}
 %
+%    Next two commands are simply syntactic sugar to go with the other
+%    \cs{DeclareUnicode...} declarations.
+% \changes{v2.0y}{2021/12/12}{Added \cs{DeclareUnicodeCommand} and
+%    \cs{DeclareUnicodeSymbol} (gh/253)}
+%    \begin{macrocode}
+\def\DeclareUnicodeSymbol#1{\DeclareTextSymbol{#1}{\UnicodeEncodingName}}
+\def\DeclareUnicodeCommand#1{\DeclareTextCommand{#1}{\UnicodeEncodingName}}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\DeclareUnicodeCommand\textquotesingle {\remove at tlig{"0027}}
+\DeclareUnicodeCommand\textasciigrave  {\remove at tlig{"0060}}
+\DeclareUnicodeCommand\textquotedbl    {\remove at tlig{"0022}}
+%    \end{macrocode}
+%
 %    \begin{macrocode}
-\DeclareTextCommand\textquotesingle \UnicodeEncodingName{%
-                                                \remove at tlig{"0027}}
-\DeclareTextCommand\textasciigrave  \UnicodeEncodingName{%
-                                                \remove at tlig{"0060}}
-\DeclareTextCommand\textquotedbl    \UnicodeEncodingName{%
-                                                \remove at tlig{"0022}}
-%    \end{macrocode}
-%
-%    \begin{macrocode}
-\DeclareTextSymbol{\textdollar}          \UnicodeEncodingName{"0024}
-\DeclareTextSymbol{\textless}            \UnicodeEncodingName{"003C}
-\DeclareTextSymbol{\textgreater}         \UnicodeEncodingName{"003E}
-\DeclareTextSymbol{\textbackslash}       \UnicodeEncodingName{"005C}
-\DeclareTextSymbol{\textasciicircum}     \UnicodeEncodingName{"005E}
-\DeclareTextSymbol{\textunderscore}      \UnicodeEncodingName{"005F}
-\DeclareTextSymbol{\textbraceleft}       \UnicodeEncodingName{"007B}
-\DeclareTextSymbol{\textbar}             \UnicodeEncodingName{"007C}
-\DeclareTextSymbol{\textbraceright}      \UnicodeEncodingName{"007D}
-\DeclareTextSymbol{\textasciitilde}      \UnicodeEncodingName{"007E}
-\DeclareTextSymbol{\textexclamdown}      \UnicodeEncodingName{"00A1}
-\DeclareTextSymbol{\textcent}            \UnicodeEncodingName{"00A2}
-\DeclareTextSymbol{\textsterling}        \UnicodeEncodingName{"00A3}
-\DeclareTextSymbol{\textcurrency}        \UnicodeEncodingName{"00A4}
-\DeclareTextSymbol{\textyen}             \UnicodeEncodingName{"00A5}
-\DeclareTextSymbol{\textbrokenbar}       \UnicodeEncodingName{"00A6}
-\DeclareTextSymbol{\textsection}         \UnicodeEncodingName{"00A7}
-\DeclareTextSymbol{\textasciidieresis}   \UnicodeEncodingName{"00A8}
-\DeclareTextSymbol{\textcopyright}       \UnicodeEncodingName{"00A9}
-\DeclareTextSymbol{\textordfeminine}     \UnicodeEncodingName{"00AA}
+\DeclareUnicodeSymbol{\textdollar}          {"0024}
+\DeclareUnicodeSymbol{\textless}            {"003C}
+\DeclareUnicodeSymbol{\textgreater}         {"003E}
+\DeclareUnicodeSymbol{\textbackslash}       {"005C}
+\DeclareUnicodeSymbol{\textasciicircum}     {"005E}
+\DeclareUnicodeSymbol{\textunderscore}      {"005F}
+\DeclareUnicodeSymbol{\textbraceleft}       {"007B}
+\DeclareUnicodeSymbol{\textbar}             {"007C}
+\DeclareUnicodeSymbol{\textbraceright}      {"007D}
+\DeclareUnicodeSymbol{\textasciitilde}      {"007E}
+\DeclareUnicodeSymbol{\textexclamdown}      {"00A1}
+\DeclareUnicodeSymbol{\textcent}            {"00A2}
+\DeclareUnicodeSymbol{\textsterling}        {"00A3}
+\DeclareUnicodeSymbol{\textcurrency}        {"00A4}
+\DeclareUnicodeSymbol{\textyen}             {"00A5}
+\DeclareUnicodeSymbol{\textbrokenbar}       {"00A6}
+\DeclareUnicodeSymbol{\textsection}         {"00A7}
+\DeclareUnicodeSymbol{\textasciidieresis}   {"00A8}
+\DeclareUnicodeSymbol{\textcopyright}       {"00A9}
+\DeclareUnicodeSymbol{\textordfeminine}     {"00AA}
 %    \end{macrocode}
 %  \changes{v2.0j}{2018/08/11}{Provide \cs{guillemetleft} and \cs{guillemetright}}
 %    \begin{macrocode}
-\DeclareTextSymbol{\guillemetleft}       \UnicodeEncodingName{"00AB}
+\DeclareUnicodeSymbol{\guillemetleft}       {"00AB}
 % old Adobe name
-\DeclareTextSymbol{\guillemotleft}       \UnicodeEncodingName{"00AB}
+\DeclareUnicodeSymbol{\guillemotleft}       {"00AB}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\DeclareTextSymbol{\textlnot}            \UnicodeEncodingName{"00AC}
-\DeclareTextSymbol{\textregistered}      \UnicodeEncodingName{"00AE}
-\DeclareTextSymbol{\textasciimacron}     \UnicodeEncodingName{"00AF}
-\DeclareTextSymbol{\textdegree}          \UnicodeEncodingName{"00B0}
-\DeclareTextSymbol{\textpm}              \UnicodeEncodingName{"00B1}
-\DeclareTextSymbol{\texttwosuperior}     \UnicodeEncodingName{"00B2}
-\DeclareTextSymbol{\textthreesuperior}   \UnicodeEncodingName{"00B3}
-\DeclareTextSymbol{\textasciiacute}      \UnicodeEncodingName{"00B4}
-\DeclareTextSymbol{\textmu}              \UnicodeEncodingName{"00B5}
-\DeclareTextSymbol{\textparagraph}       \UnicodeEncodingName{"00B6}
-\DeclareTextSymbol{\textperiodcentered}  \UnicodeEncodingName{"00B7}
-\DeclareTextSymbol{\textonesuperior}     \UnicodeEncodingName{"00B9}
-\DeclareTextSymbol{\textordmasculine}    \UnicodeEncodingName{"00BA}
+\DeclareUnicodeSymbol{\textlnot}            {"00AC}
+\DeclareUnicodeSymbol{\textregistered}      {"00AE}
+\DeclareUnicodeSymbol{\textasciimacron}     {"00AF}
+\DeclareUnicodeSymbol{\textdegree}          {"00B0}
+\DeclareUnicodeSymbol{\textpm}              {"00B1}
+\DeclareUnicodeSymbol{\texttwosuperior}     {"00B2}
+\DeclareUnicodeSymbol{\textthreesuperior}   {"00B3}
+\DeclareUnicodeSymbol{\textasciiacute}      {"00B4}
+\DeclareUnicodeSymbol{\textmu}              {"00B5}
+\DeclareUnicodeSymbol{\textparagraph}       {"00B6}
+\DeclareUnicodeSymbol{\textperiodcentered}  {"00B7}
+\DeclareUnicodeSymbol{\textonesuperior}     {"00B9}
+\DeclareUnicodeSymbol{\textordmasculine}    {"00BA}
 %    \end{macrocode}
 %  \changes{v2.0j}{2018/08/11}{Provide \cs{guillemetleft} and \cs{guillemetright}}
 %    \begin{macrocode}
-\DeclareTextSymbol{\guillemetright}      \UnicodeEncodingName{"00BB}
+\DeclareUnicodeSymbol{\guillemetright}      {"00BB}
 % old Adobe name
-\DeclareTextSymbol{\guillemotright}      \UnicodeEncodingName{"00BB}
-%    \end{macrocode}
-%
-%    \begin{macrocode}
-\DeclareTextSymbol{\textonequarter}      \UnicodeEncodingName{"00BC}
-\DeclareTextSymbol{\textonehalf}         \UnicodeEncodingName{"00BD}
-\DeclareTextSymbol{\textthreequarters}   \UnicodeEncodingName{"00BE}
-\DeclareTextSymbol{\textquestiondown}    \UnicodeEncodingName{"00BF}
-\DeclareTextSymbol{\AE}                  \UnicodeEncodingName{"00C6}
-\DeclareTextSymbol{\DH}                  \UnicodeEncodingName{"00D0}
-\DeclareTextSymbol{\texttimes}           \UnicodeEncodingName{"00D7}
-\DeclareTextSymbol{\O}                   \UnicodeEncodingName{"00D8}
-\DeclareTextSymbol{\TH}                  \UnicodeEncodingName{"00DE}
-\DeclareTextSymbol{\ss}                  \UnicodeEncodingName{"00DF}
-\DeclareTextSymbol{\ae}                  \UnicodeEncodingName{"00E6}
-\DeclareTextSymbol{\dh}                  \UnicodeEncodingName{"00F0}
-\DeclareTextSymbol{\textdiv}             \UnicodeEncodingName{"00F7}
-\DeclareTextSymbol{\o}                   \UnicodeEncodingName{"00F8}
-\DeclareTextSymbol{\th}                  \UnicodeEncodingName{"00FE}
-\DeclareTextSymbol{\DJ}                  \UnicodeEncodingName{"0110}
-\DeclareTextSymbol{\dj}                  \UnicodeEncodingName{"0111}
-\DeclareTextSymbol{\i}                   \UnicodeEncodingName{"0131}
-\DeclareTextSymbol{\IJ}                  \UnicodeEncodingName{"0132}
-\DeclareTextSymbol{\ij}                  \UnicodeEncodingName{"0133}
-\DeclareTextSymbol{\L}                   \UnicodeEncodingName{"0141}
-\DeclareTextSymbol{\l}                   \UnicodeEncodingName{"0142}
-\DeclareTextSymbol{\NG}                  \UnicodeEncodingName{"014A}
-\DeclareTextSymbol{\ng}                  \UnicodeEncodingName{"014B}
-\DeclareTextSymbol{\OE}                  \UnicodeEncodingName{"0152}
-\DeclareTextSymbol{\oe}                  \UnicodeEncodingName{"0153}
-\DeclareTextSymbol{\textflorin}          \UnicodeEncodingName{"0192}
-\DeclareTextSymbol{\j}                   \UnicodeEncodingName{"0237}
-\DeclareTextSymbol{\textasciicaron}      \UnicodeEncodingName{"02C7}
-\DeclareTextSymbol{\textasciibreve}      \UnicodeEncodingName{"02D8}
-\DeclareTextSymbol{\textacutedbl}        \UnicodeEncodingName{"02DD}
-\DeclareTextSymbol{\textgravedbl}        \UnicodeEncodingName{"02F5}
-\DeclareTextSymbol{\texttildelow}        \UnicodeEncodingName{"02F7}
-\DeclareTextSymbol{\textbaht}            \UnicodeEncodingName{"0E3F}
-\DeclareTextSymbol{\SS}                  \UnicodeEncodingName{"1E9E}
-\DeclareTextSymbol{\textcompwordmark}    \UnicodeEncodingName{"200C}
+\DeclareUnicodeSymbol{\guillemotright}      {"00BB}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\DeclareUnicodeSymbol{\textonequarter}      {"00BC}
+\DeclareUnicodeSymbol{\textonehalf}         {"00BD}
+\DeclareUnicodeSymbol{\textthreequarters}   {"00BE}
+\DeclareUnicodeSymbol{\textquestiondown}    {"00BF}
+\DeclareUnicodeSymbol{\AE}                  {"00C6}
+\DeclareUnicodeSymbol{\DH}                  {"00D0}
+\DeclareUnicodeSymbol{\texttimes}           {"00D7}
+\DeclareUnicodeSymbol{\O}                   {"00D8}
+\DeclareUnicodeSymbol{\TH}                  {"00DE}
+\DeclareUnicodeSymbol{\ss}                  {"00DF}
+\DeclareUnicodeSymbol{\ae}                  {"00E6}
+\DeclareUnicodeSymbol{\dh}                  {"00F0}
+\DeclareUnicodeSymbol{\textdiv}             {"00F7}
+\DeclareUnicodeSymbol{\o}                   {"00F8}
+\DeclareUnicodeSymbol{\th}                  {"00FE}
+\DeclareUnicodeSymbol{\DJ}                  {"0110}
+\DeclareUnicodeSymbol{\dj}                  {"0111}
+\DeclareUnicodeSymbol{\i}                   {"0131}
+\DeclareUnicodeSymbol{\IJ}                  {"0132}
+\DeclareUnicodeSymbol{\ij}                  {"0133}
+\DeclareUnicodeSymbol{\L}                   {"0141}
+\DeclareUnicodeSymbol{\l}                   {"0142}
+\DeclareUnicodeSymbol{\NG}                  {"014A}
+\DeclareUnicodeSymbol{\ng}                  {"014B}
+\DeclareUnicodeSymbol{\OE}                  {"0152}
+\DeclareUnicodeSymbol{\oe}                  {"0153}
+\DeclareUnicodeSymbol{\textflorin}          {"0192}
+\DeclareUnicodeSymbol{\j}                   {"0237}
+\DeclareUnicodeSymbol{\textasciicaron}      {"02C7}
+\DeclareUnicodeSymbol{\textasciibreve}      {"02D8}
+\DeclareUnicodeSymbol{\textacutedbl}        {"02DD}
+\DeclareUnicodeSymbol{\textgravedbl}        {"02F5}
+\DeclareUnicodeSymbol{\texttildelow}        {"02F7}
+\DeclareUnicodeSymbol{\textbaht}            {"0E3F}
+\DeclareUnicodeSymbol{\SS}                  {"1E9E}
+\DeclareUnicodeSymbol{\textcompwordmark}    {"200C}
 %    \end{macrocode}
 %    
 % \changes{v2.0u}{2021/02/19}{Add \cs{textnonbreakinghyphen}, \cs{textfiguredash}
 %      and \cs{texthorizontalbar} (gh/404)}
 %    \begin{macrocode}
-%\DeclareTextSymbol{\textnonbreakinghyphen} \UnicodeEncodingName{"2011}
-%\DeclareTextSymbol{\textfiguredash}        \UnicodeEncodingName{"2012}
-\DeclareTextSymbol{\textendash}          \UnicodeEncodingName{"2013}
-\DeclareTextSymbol{\textemdash}          \UnicodeEncodingName{"2014}
-%\DeclareTextSymbol{\texthorizontalbar}   \UnicodeEncodingName{"2015}
+%\DeclareUnicodeSymbol{\textnonbreakinghyphen} {"2011}
+%\DeclareUnicodeSymbol{\textfiguredash}        {"2012}
+\DeclareUnicodeSymbol{\textendash}          {"2013}
+\DeclareUnicodeSymbol{\textemdash}          {"2014}
+%\DeclareUnicodeSymbol{\texthorizontalbar}   {"2015}
 %    \end{macrocode}
 %    Unfortunately some fonts do not implement \texttt{"2011}, \texttt{"2012} and/or
 %    \texttt{"2015} (including the \LaTeX{} default fonts for Unicode
@@ -3175,70 +3206,70 @@
 %    The \verb=\nobreak\hskip\z@= is there to prevent a break after
 %    the hyphen but allow later breaks in the remainder of the word. 
 %    \begin{macrocode}
-\DeclareTextCommand{\textnonbreakinghyphen} \UnicodeEncodingName
+\DeclareUnicodeCommand{\textnonbreakinghyphen} 
      {\iffontchar\font "2011 \char "2011 \else \mbox{-}\nobreak\hskip\z@ \fi}
-\DeclareTextCommand{\textfiguredash}     \UnicodeEncodingName
+\DeclareUnicodeCommand{\textfiguredash}     
      {\iffontchar\font "2012 \char "2012 \else \char "2013 \fi}
-\DeclareTextCommand{\texthorizontalbar}     \UnicodeEncodingName
+\DeclareUnicodeCommand{\texthorizontalbar}     
      {\iffontchar\font "2015 \char "2015 \else \char "2014 \fi}
 %    \end{macrocode}
 %    
 %    \begin{macrocode}
-\DeclareTextSymbol{\textbardbl}          \UnicodeEncodingName{"2016}
-\DeclareTextSymbol{\textquoteleft}       \UnicodeEncodingName{"2018}
-\DeclareTextSymbol{\textquoteright}      \UnicodeEncodingName{"2019}
-\DeclareTextSymbol{\quotesinglbase}      \UnicodeEncodingName{"201A}
-\DeclareTextSymbol{\textquotedblleft}    \UnicodeEncodingName{"201C}
-\DeclareTextSymbol{\textquotedblright}   \UnicodeEncodingName{"201D}
-\DeclareTextSymbol{\quotedblbase}        \UnicodeEncodingName{"201E}
-\DeclareTextSymbol{\textdagger}          \UnicodeEncodingName{"2020}
-\DeclareTextSymbol{\textdaggerdbl}       \UnicodeEncodingName{"2021}
-\DeclareTextSymbol{\textbullet}          \UnicodeEncodingName{"2022}
-\DeclareTextSymbol{\textellipsis}        \UnicodeEncodingName{"2026}
-\DeclareTextSymbol{\textperthousand}     \UnicodeEncodingName{"2030}
-\DeclareTextSymbol{\textpertenthousand}  \UnicodeEncodingName{"2031}
-\DeclareTextSymbol{\guilsinglleft}       \UnicodeEncodingName{"2039}
-\DeclareTextSymbol{\guilsinglright}      \UnicodeEncodingName{"203A}
-\DeclareTextSymbol{\textreferencemark}   \UnicodeEncodingName{"203B}
-\DeclareTextSymbol{\textinterrobang}     \UnicodeEncodingName{"203D}
-\DeclareTextSymbol{\textfractionsolidus} \UnicodeEncodingName{"2044}
-\DeclareTextSymbol{\textlquill}          \UnicodeEncodingName{"2045}
-\DeclareTextSymbol{\textrquill}          \UnicodeEncodingName{"2046}
-\DeclareTextSymbol{\textdiscount}        \UnicodeEncodingName{"2052}
-\DeclareTextSymbol{\textcolonmonetary}   \UnicodeEncodingName{"20A1}
-\DeclareTextSymbol{\textlira}            \UnicodeEncodingName{"20A4}
-\DeclareTextSymbol{\textnaira}           \UnicodeEncodingName{"20A6}
-\DeclareTextSymbol{\textwon}             \UnicodeEncodingName{"20A9}
-\DeclareTextSymbol{\textdong}            \UnicodeEncodingName{"20AB}
-\DeclareTextSymbol{\texteuro}            \UnicodeEncodingName{"20AC}
-\DeclareTextSymbol{\textpeso}            \UnicodeEncodingName{"20B1}
-\DeclareTextSymbol{\textcelsius}         \UnicodeEncodingName{"2103}
-\DeclareTextSymbol{\textnumero}          \UnicodeEncodingName{"2116}
-\DeclareTextSymbol{\textcircledP}        \UnicodeEncodingName{"2117}
-\DeclareTextSymbol{\textrecipe}          \UnicodeEncodingName{"211E}
-\DeclareTextSymbol{\textservicemark}     \UnicodeEncodingName{"2120}
-\DeclareTextSymbol{\texttrademark}       \UnicodeEncodingName{"2122}
-\DeclareTextSymbol{\textohm}             \UnicodeEncodingName{"2126}
-\DeclareTextSymbol{\textmho}             \UnicodeEncodingName{"2127}
-\DeclareTextSymbol{\textestimated}       \UnicodeEncodingName{"212E}
-\DeclareTextSymbol{\textleftarrow}       \UnicodeEncodingName{"2190}
-\DeclareTextSymbol{\textuparrow}         \UnicodeEncodingName{"2191}
-\DeclareTextSymbol{\textrightarrow}      \UnicodeEncodingName{"2192}
-\DeclareTextSymbol{\textdownarrow}       \UnicodeEncodingName{"2193}
-\DeclareTextSymbol{\textminus}           \UnicodeEncodingName{"2212}
+\DeclareUnicodeSymbol{\textbardbl}          {"2016}
+\DeclareUnicodeSymbol{\textquoteleft}       {"2018}
+\DeclareUnicodeSymbol{\textquoteright}      {"2019}
+\DeclareUnicodeSymbol{\quotesinglbase}      {"201A}
+\DeclareUnicodeSymbol{\textquotedblleft}    {"201C}
+\DeclareUnicodeSymbol{\textquotedblright}   {"201D}
+\DeclareUnicodeSymbol{\quotedblbase}        {"201E}
+\DeclareUnicodeSymbol{\textdagger}          {"2020}
+\DeclareUnicodeSymbol{\textdaggerdbl}       {"2021}
+\DeclareUnicodeSymbol{\textbullet}          {"2022}
+\DeclareUnicodeSymbol{\textellipsis}        {"2026}
+\DeclareUnicodeSymbol{\textperthousand}     {"2030}
+\DeclareUnicodeSymbol{\textpertenthousand}  {"2031}
+\DeclareUnicodeSymbol{\guilsinglleft}       {"2039}
+\DeclareUnicodeSymbol{\guilsinglright}      {"203A}
+\DeclareUnicodeSymbol{\textreferencemark}   {"203B}
+\DeclareUnicodeSymbol{\textinterrobang}     {"203D}
+\DeclareUnicodeSymbol{\textfractionsolidus} {"2044}
+\DeclareUnicodeSymbol{\textlquill}          {"2045}
+\DeclareUnicodeSymbol{\textrquill}          {"2046}
+\DeclareUnicodeSymbol{\textdiscount}        {"2052}
+\DeclareUnicodeSymbol{\textcolonmonetary}   {"20A1}
+\DeclareUnicodeSymbol{\textlira}            {"20A4}
+\DeclareUnicodeSymbol{\textnaira}           {"20A6}
+\DeclareUnicodeSymbol{\textwon}             {"20A9}
+\DeclareUnicodeSymbol{\textdong}            {"20AB}
+\DeclareUnicodeSymbol{\texteuro}            {"20AC}
+\DeclareUnicodeSymbol{\textpeso}            {"20B1}
+\DeclareUnicodeSymbol{\textcelsius}         {"2103}
+\DeclareUnicodeSymbol{\textnumero}          {"2116}
+\DeclareUnicodeSymbol{\textcircledP}        {"2117}
+\DeclareUnicodeSymbol{\textrecipe}          {"211E}
+\DeclareUnicodeSymbol{\textservicemark}     {"2120}
+\DeclareUnicodeSymbol{\texttrademark}       {"2122}
+\DeclareUnicodeSymbol{\textohm}             {"2126}
+\DeclareUnicodeSymbol{\textmho}             {"2127}
+\DeclareUnicodeSymbol{\textestimated}       {"212E}
+\DeclareUnicodeSymbol{\textleftarrow}       {"2190}
+\DeclareUnicodeSymbol{\textuparrow}         {"2191}
+\DeclareUnicodeSymbol{\textrightarrow}      {"2192}
+\DeclareUnicodeSymbol{\textdownarrow}       {"2193}
+\DeclareUnicodeSymbol{\textminus}           {"2212}
 
 %    \end{macrocode}
 %  \changes{v2.0k}{2018/11/18}{Provide \cs{Hwithstroke} and \cs{hwithstroke}}
 %    \begin{macrocode}
-\DeclareTextSymbol{\Hwithstroke}         \UnicodeEncodingName{"0126}
-\DeclareTextSymbol{\hwithstroke}         \UnicodeEncodingName{"0127}
+\DeclareUnicodeSymbol{\Hwithstroke}         {"0126}
+\DeclareUnicodeSymbol{\hwithstroke}         {"0127}
 %    \end{macrocode}
 %
 % Not all fonts have U+2217 but using U+002A requires some adjustment.
 % \changes{v2.0t}{2021/02/17}{Adjust values for
 %        \cs{textasteriskcentered} To match TS1 definition (gh/502)}
 %    \begin{macrocode}
-\DeclareTextCommand{\textasteriskcentered}\UnicodeEncodingName{%
+\DeclareUnicodeCommand{\textasteriskcentered}{%
   \iffontchar\font"2217 \char"2217 \else
     \begingroup
       \fontsize
@@ -3251,36 +3282,39 @@
 }
 %    \end{macrocode}
 %    \begin{macrocode}
-\DeclareTextSymbol{\textsurd}            \UnicodeEncodingName{"221A}
-\DeclareTextSymbol{\textlangle}          \UnicodeEncodingName{"2329}
-\DeclareTextSymbol{\textrangle}          \UnicodeEncodingName{"232A}
-\DeclareTextSymbol{\textblank}           \UnicodeEncodingName{"2422}
-\DeclareTextSymbol{\textvisiblespace}    \UnicodeEncodingName{"2423}
-\DeclareTextSymbol{\textopenbullet}      \UnicodeEncodingName{"25E6}
-\DeclareTextSymbol{\textbigcircle}       \UnicodeEncodingName{"25EF}
-\DeclareTextSymbol{\textmusicalnote}     \UnicodeEncodingName{"266A}
-\DeclareTextSymbol{\textmarried}         \UnicodeEncodingName{"26AD}
-\DeclareTextSymbol{\textdivorced}        \UnicodeEncodingName{"26AE}
-\DeclareTextSymbol{\textinterrobangdown} \UnicodeEncodingName{"2E18}
+\DeclareUnicodeSymbol{\textsurd}            {"221A}
+\DeclareUnicodeSymbol{\textlangle}          {"2329}
+\DeclareUnicodeSymbol{\textrangle}          {"232A}
+\DeclareUnicodeSymbol{\textblank}           {"2422}
+\DeclareUnicodeSymbol{\textvisiblespace}    {"2423}
+\DeclareUnicodeSymbol{\textopenbullet}      {"25E6}
+\DeclareUnicodeSymbol{\textbigcircle}       {"25EF}
+\DeclareUnicodeSymbol{\textmusicalnote}     {"266A}
+\DeclareUnicodeSymbol{\textmarried}         {"26AD}
+\DeclareUnicodeSymbol{\textdivorced}        {"26AE}
+\DeclareUnicodeSymbol{\textinterrobangdown} {"2E18}
 %    \end{macrocode}
 % Accents must be declared before the composites that use them.
 %    \begin{macrocode}
-\DeclareUnicodeAccent{\`}                \UnicodeEncodingName{"0300}
-\DeclareUnicodeAccent{\'}                \UnicodeEncodingName{"0301}
-\DeclareUnicodeAccent{\^}                \UnicodeEncodingName{"0302}
-\DeclareUnicodeAccent{\~}                \UnicodeEncodingName{"0303}
-\DeclareUnicodeAccent{\=}                \UnicodeEncodingName{"0304}
-\DeclareUnicodeAccent{\u}                \UnicodeEncodingName{"0306}
-\DeclareUnicodeAccent{\.}                \UnicodeEncodingName{"0307}
-\DeclareUnicodeAccent{\"}                \UnicodeEncodingName{"0308}
-\DeclareUnicodeAccent{\r}                \UnicodeEncodingName{"030A}
-\DeclareUnicodeAccent{\H}                \UnicodeEncodingName{"030B}
-\DeclareUnicodeAccent{\v}                \UnicodeEncodingName{"030C}
-\DeclareUnicodeAccent{\b}                \UnicodeEncodingName{"0332}
-\DeclareUnicodeAccent{\d}                \UnicodeEncodingName{"0323}
-\DeclareUnicodeAccent{\c}                \UnicodeEncodingName{"0327}
-\DeclareUnicodeAccent{\k}                \UnicodeEncodingName{"0328}
-\DeclareTextCommand\textcommabelow       \UnicodeEncodingName[1]
+\DeclareUnicodeAccent{\`}{"0300}
+\DeclareUnicodeAccent{\'}{"0301}
+\DeclareUnicodeAccent{\^}{"0302}
+\DeclareUnicodeAccent{\~}{"0303}
+\DeclareUnicodeAccent{\=}{"0304}
+\DeclareUnicodeAccent{\u}{"0306}
+\DeclareUnicodeAccent{\.}{"0307}
+\DeclareUnicodeAccent{\"}{"0308}
+\DeclareUnicodeAccent{\r}{"030A}
+\DeclareUnicodeAccent{\H}{"030B}
+\DeclareUnicodeAccent{\v}{"030C}
+\DeclareUnicodeAccent{\b}{"0332}
+\DeclareUnicodeAccent{\d}{"0323}
+\DeclareUnicodeAccent{\c}{"0327}
+\DeclareUnicodeAccent{\k}{"0328}
+%    \end{macrocode}
+%    The odd one out:
+%    \begin{macrocode}
+\DeclareUnicodeCommand\textcommabelow[1]
   {\hmode at bgroup\ooalign{\null#1\crcr\hidewidth\raise-.31ex
    \hbox{\check at mathfonts\fontsize\ssf at size\z@
    \math at fontsfalse\selectfont,}\hidewidth}\egroup}
diff --git a/base/testfiles-TU/github-0253.lvt b/base/testfiles-TU/github-0253.lvt
new file mode 100644
index 00000000..f09b24a7
--- /dev/null
+++ b/base/testfiles-TU/github-0253.lvt
@@ -0,0 +1,31 @@
+\documentclass{article}
+
+\pagestyle{empty}
+
+\input{test2e}
+
+\START
+
+\ShowCommand\=
+\expandafter\show
+\csname TU\string\=\endcsname
+
+\DeclareUnicodeAccent{\=}\UnicodeEncodingName{"0300}
+
+% composites change the internals, so we have to apply at least one again
+\DeclareUnicodeComposite{\=}             {A}{"0100}
+
+\ShowCommand\=
+\expandafter\show
+\csname TU\string\=\endcsname
+
+
+\DeclareUnicodeAccent{\=}{"0304}           % new syntax
+\relax          
+\DeclareUnicodeComposite{\=}             {A}{"0100}
+
+\ShowCommand\=
+\expandafter\show
+\csname TU\string\=\endcsname
+
+\END
diff --git a/base/testfiles-TU/github-0253.tlg b/base/testfiles-TU/github-0253.tlg
new file mode 100644
index 00000000..054fa5e5
--- /dev/null
+++ b/base/testfiles-TU/github-0253.tlg
@@ -0,0 +1,26 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+> \==macro:
+->\TU-cmd \=\TU\= .
+<argument> \=
+l. ...\ShowCommand\=
+> \TU\==macro:
+#1->\@text at composite \TU\= #1\@empty \@text at composite {\add at unicode@accent {"0304}{#1}}.
+<recently read> \TU\= 
+l. ...\csname TU\string\=\endcsname
+> \==macro:
+->\TU-cmd \=\TU\= .
+<argument> \=
+l. ...\ShowCommand\=
+> \TU\==macro:
+#1->\@text at composite \TU\= #1\@empty \@text at composite {\add at unicode@accent {"0300}{#1}}.
+<recently read> \TU\= 
+l. ...\csname TU\string\=\endcsname
+> \==macro:
+->\TU-cmd \=\TU\= .
+<argument> \=
+l. ...\ShowCommand\=
+> \TU\==macro:
+#1->\@text at composite \TU\= #1\@empty \@text at composite {\add at unicode@accent {"0304}{#1}}.
+<recently read> \TU\= 
+l. ...\csname TU\string\=\endcsname





More information about the latex3-commits mailing list.