[latex3-commits] [git/LaTeX3-latex3-latex3] master: Adjust cctab code for ConTeXt when loading generically (fixes #783) (c2cc0458c)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Jul 27 12:50:16 CEST 2020


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

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

commit c2cc0458c66df5b96d56f664ba6205ab5393afca
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Jul 27 11:49:29 2020 +0100

    Adjust cctab code for ConTeXt when loading generically (fixes #783)
    
    In ConTeXT:
    
    - The allocator is set at the current 'top' register
    - \newcatcodetable doesn't do \initcatcodetable


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

c2cc0458c66df5b96d56f664ba6205ab5393afca
 l3kernel/CHANGELOG.md |  3 +++
 l3kernel/l3cctab.dtx  | 15 ++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 138685615..f1b82fffe 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Fixed
+- Loading generically on ConTeXt (issue #783)
+
 ## [2020-07-17]
 
 ### Added
diff --git a/l3kernel/l3cctab.dtx b/l3kernel/l3cctab.dtx
index 25becd59f..392ddf62b 100644
--- a/l3kernel/l3cctab.dtx
+++ b/l3kernel/l3cctab.dtx
@@ -242,6 +242,8 @@
 %
 %   First, the \LuaTeX{} case.
 %   Creating a new category code table is done like other registers.
+%   In Con\TeX{}t, \tn{newcatcodetable} does not include the initialisation,
+%   so that is added explicitly.
 %    \begin{macrocode}
 \sys_if_engine_luatex:TF
   {
@@ -267,7 +269,11 @@
       }
 %</initex>
 %<*package>
-    \cs_new_eq:NN \@@_new:N \newcatcodetable
+    \cs_new_protected:Npn \@@_new:N #1
+      {
+        \newcatcodetable #1
+        \tex_initcatcodetable:D #1
+      }
 %</package>
   }
 %    \end{macrocode}
@@ -725,6 +731,13 @@
         \int_compare:nNnTF {#1-1} < { \e at alloc@ccodetable at count }
 %</package>
       }
+    \cs_if_exist:NT \c_syst_catcodes_n
+      {
+        \cs_gset_protected:Npn \@@_chk_if_valid_aux:NTF #1
+          {
+            \int_compare:nTF { #1 <= \c_syst_catcodes_n }
+          }
+      }
   }
   {
     \cs_new_protected:Npn \@@_chk_if_valid_aux:NTF #1





More information about the latex3-commits mailing list.