[latex3-commits] [git/LaTeX3-latex3-latex3] master: Guard against active ^^@ being defined (d0ab771)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Apr 25 18:44:04 CEST 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/d0ab771d871bf9bac92f4a3f720b53c570833024

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

commit d0ab771d871bf9bac92f4a3f720b53c570833024
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Apr 25 17:44:04 2018 +0100

    Guard against active ^^@ being defined
    
    For example for xmltex.


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

d0ab771d871bf9bac92f4a3f720b53c570833024
 l3kernel/l3expan.dtx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/l3kernel/l3expan.dtx b/l3kernel/l3expan.dtx
index 2246098..6cadc05 100644
--- a/l3kernel/l3expan.dtx
+++ b/l3kernel/l3expan.dtx
@@ -1534,10 +1534,15 @@
 %    \end{macrocode}
 %    If the above definition ever appears outside its proper context
 %    the active character |^^@| will be executed so we turn this into an
-%    error.
+%    error. The test for existence covers the (unlikely) case that some
+%    other code has already defined |^^@|: this is true for example for
+%    \texttt{xmltex.tex}.
 %    \begin{macrocode}
-  \cs_new:Npn ^^@
-    { \__kernel_msg_expandable_error:nn { kernel } { bad-exp-end-f } }
+  \if_cs_exist:N ^^@
+  \else:
+    \cs_new:Npn ^^@
+      { \__kernel_msg_expandable_error:nn { kernel } { bad-exp-end-f } }
+  \fi:
 %    \end{macrocode}
 %   The same but grabbing an argument to remove spaces and braces.
 %    \begin{macrocode}





More information about the latex3-commits mailing list