[latex3-commits] [git/latex3] master: Turn on the check-declarations for xfont (see #420) (bb4c290)

Bruno Le Floch bruno at le-floch.fr
Wed Nov 29 16:34:27 CET 2017


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

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

commit bb4c290e3927675f411e2d8f50c87412f2777550
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Wed Nov 29 09:49:50 2017 -0500

    Turn on the check-declarations for xfont (see #420)


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

bb4c290e3927675f411e2d8f50c87412f2777550
 l3trial/xfont/testfiles-disabled/l3font001.lvt |    4 +-
 l3trial/xfont/testfiles-disabled/l3xfss001.lvt |    4 +-
 l3trial/xfont/testfiles/l3font000.luatex.tlg   |    4 +-
 l3trial/xfont/testfiles/l3font000.lvt          |    2 +-
 l3trial/xfont/testfiles/l3font000.ptex.tlg     |    4 +-
 l3trial/xfont/testfiles/l3font000.tlg          |    4 +-
 l3trial/xfont/testfiles/l3font000.uptex.tlg    |    4 +-
 l3trial/xfont/testfiles/l3font000.xetex.tlg    |    4 +-
 l3trial/xfont/testfiles/l3font001.lvt          |    4 +-
 l3trial/xfont/xfss-setup.dtx                   |    6 +++
 l3trial/xfont/xfss.dtx                         |   62 ++++++++++++++++--------
 11 files changed, 65 insertions(+), 37 deletions(-)

diff --git a/l3trial/xfont/testfiles-disabled/l3font001.lvt b/l3trial/xfont/testfiles-disabled/l3font001.lvt
index 1d3a845..193e661 100644
--- a/l3trial/xfont/testfiles-disabled/l3font001.lvt
+++ b/l3trial/xfont/testfiles-disabled/l3font001.lvt
@@ -1,11 +1,11 @@
 %
-% Copyright (C) 2011 LaTeX3 Project
+% Copyright (C) 2011,2017 LaTeX3 Project
 %
 
 \documentclass{minimal}
 \input{regression-test}
 
-\RequirePackage{expl3}
+\RequirePackage[check-declarations]{expl3}
 \RequirePackage{l3font}
 
 \begin{document}
diff --git a/l3trial/xfont/testfiles-disabled/l3xfss001.lvt b/l3trial/xfont/testfiles-disabled/l3xfss001.lvt
index 30edd5a..c6fed26 100644
--- a/l3trial/xfont/testfiles-disabled/l3xfss001.lvt
+++ b/l3trial/xfont/testfiles-disabled/l3xfss001.lvt
@@ -1,7 +1,7 @@
 %
-% Copyright (C) 2011 LaTeX3 Project
+% Copyright (C) 2011,2017 LaTeX3 Project
 %
-\RequirePackage{expl3}
+\RequirePackage[check-declarations]{expl3}
 \RequirePackage{xfss}
 \documentclass{minimal}
 \input{regression-test}
diff --git a/l3trial/xfont/testfiles/l3font000.luatex.tlg b/l3trial/xfont/testfiles/l3font000.luatex.tlg
index 679261b..ef0ecf8 100644
--- a/l3trial/xfont/testfiles/l3font000.luatex.tlg
+++ b/l3trial/xfont/testfiles/l3font000.luatex.tlg
@@ -88,7 +88,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/define-command"
 . 
 . Defining command \xfss_set_size_funct_args:w with sig. 'O{}u{\q_nil }' on
-. line 931.
+. line 946.
 .................................................
 .................................................
 . LaTeX info: "xparse/redefine-command"
@@ -119,7 +119,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/redefine-command"
 . 
 . Redefining command \DeclareTextCompositeCommand with sig. 'mmmm' on line
-. 1298.
+. 1317.
 .................................................
 .................................................
 . LaTeX info: "xparse/redefine-command"
diff --git a/l3trial/xfont/testfiles/l3font000.lvt b/l3trial/xfont/testfiles/l3font000.lvt
index ca2ffac..c219a0f 100644
--- a/l3trial/xfont/testfiles/l3font000.lvt
+++ b/l3trial/xfont/testfiles/l3font000.lvt
@@ -4,7 +4,7 @@
 
 \documentclass{minimal}
 \input{regression-test}
-\RequirePackage[enable-debug]{expl3}
+\RequirePackage[enable-debug,check-declarations]{expl3}
 \RequirePackage{xparse}
 \ExplSyntaxOn
 \debug_on:n { deprecation }
diff --git a/l3trial/xfont/testfiles/l3font000.ptex.tlg b/l3trial/xfont/testfiles/l3font000.ptex.tlg
index 679261b..ef0ecf8 100644
--- a/l3trial/xfont/testfiles/l3font000.ptex.tlg
+++ b/l3trial/xfont/testfiles/l3font000.ptex.tlg
@@ -88,7 +88,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/define-command"
 . 
 . Defining command \xfss_set_size_funct_args:w with sig. 'O{}u{\q_nil }' on
-. line 931.
+. line 946.
 .................................................
 .................................................
 . LaTeX info: "xparse/redefine-command"
@@ -119,7 +119,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/redefine-command"
 . 
 . Redefining command \DeclareTextCompositeCommand with sig. 'mmmm' on line
-. 1298.
+. 1317.
 .................................................
 .................................................
 . LaTeX info: "xparse/redefine-command"
diff --git a/l3trial/xfont/testfiles/l3font000.tlg b/l3trial/xfont/testfiles/l3font000.tlg
index c37853e..53d4468 100644
--- a/l3trial/xfont/testfiles/l3font000.tlg
+++ b/l3trial/xfont/testfiles/l3font000.tlg
@@ -88,7 +88,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/define-command"
 . 
 . Defining command \xfss_set_size_funct_args:w with sig. 'O{}u{\q_nil }' on
-. line 931.
+. line 946.
 .................................................
 .................................................
 . LaTeX info: "xparse/redefine-command"
@@ -119,7 +119,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/redefine-command"
 . 
 . Redefining command \DeclareTextCompositeCommand with sig. 'mmmm' on line
-. 1298.
+. 1317.
 .................................................
 .................................................
 . LaTeX info: "xparse/redefine-command"
diff --git a/l3trial/xfont/testfiles/l3font000.uptex.tlg b/l3trial/xfont/testfiles/l3font000.uptex.tlg
index 04d03d9..70928bb 100644
--- a/l3trial/xfont/testfiles/l3font000.uptex.tlg
+++ b/l3trial/xfont/testfiles/l3font000.uptex.tlg
@@ -88,7 +88,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/define-command"
 . 
 . Defining command \xfss_set_size_funct_args:w with sig. 'O{}u{\q_nil }' on
-. line 931.
+. line 946.
 .................................................
 .................................................
 . LaTeX info: "xparse/redefine-command"
@@ -119,7 +119,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/redefine-command"
 . 
 . Redefining command \DeclareTextCompositeCommand with sig. 'mmmm' on line
-. 1298.
+. 1317.
 .................................................
 .................................................
 . LaTeX info: "xparse/redefine-command"
diff --git a/l3trial/xfont/testfiles/l3font000.xetex.tlg b/l3trial/xfont/testfiles/l3font000.xetex.tlg
index 9291fe9..73dfea2 100644
--- a/l3trial/xfont/testfiles/l3font000.xetex.tlg
+++ b/l3trial/xfont/testfiles/l3font000.xetex.tlg
@@ -88,7 +88,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/define-command"
 . 
 . Defining command \xfss_set_size_funct_args:w with sig. 'O{}u{\q_nil }' on
-. line 931.
+. line 946.
 .................................................
 .................................................
 . LaTeX info: "xparse/redefine-command"
@@ -119,7 +119,7 @@ Author: Bruno Le Floch
 . LaTeX info: "xparse/redefine-command"
 . 
 . Redefining command \DeclareTextCompositeCommand with sig. 'mmmm' on line
-. 1298.
+. 1317.
 .................................................
 .................................................
 . LaTeX info: "xparse/redefine-command"
diff --git a/l3trial/xfont/testfiles/l3font001.lvt b/l3trial/xfont/testfiles/l3font001.lvt
index 6e0b9d7..1d859da 100644
--- a/l3trial/xfont/testfiles/l3font001.lvt
+++ b/l3trial/xfont/testfiles/l3font001.lvt
@@ -1,11 +1,11 @@
 %
-% Copyright (C) 2011 LaTeX3 Project
+% Copyright (C) 2011,2017 LaTeX3 Project
 %
 
 \documentclass{minimal}
 \input{regression-test}
 
-\RequirePackage{expl3}
+\RequirePackage[check-declarations]{expl3}
 \RequirePackage{l3font}
 
 \begin{document}
diff --git a/l3trial/xfont/xfss-setup.dtx b/l3trial/xfont/xfss-setup.dtx
index 8e265e7..b3f6edb 100644
--- a/l3trial/xfont/xfss-setup.dtx
+++ b/l3trial/xfont/xfss-setup.dtx
@@ -299,6 +299,12 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
+\tl_map_inline:nn
+  {
+    { rm } { sf } { tt } { bf } { md } { it } { sl } { sc } { up }
+    { encoding } { family } { series } { shape }
+  }
+  { \tl_clear_new:c { #1 default } }
 \tl_set:Nn \rmdefault{lmr}
 \tl_set:Nn \sfdefault{lmss}
 \tl_set:Nn \ttdefault{lmtt}
diff --git a/l3trial/xfont/xfss.dtx b/l3trial/xfont/xfss.dtx
index 5421881..4e6c400 100644
--- a/l3trial/xfont/xfss.dtx
+++ b/l3trial/xfont/xfss.dtx
@@ -904,10 +904,20 @@
 \tl_new:N \l_xfss_tmpb_tl
 \tl_new:N \l_xfss_tmpc_tl
 \tl_new:N \l_xfss_tmpd_tl
+\tl_new:N \l_xfss_tmpf_tl
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\tl_clear:N \g_xfss_curr_math_size_tl
+\tl_new:N \l_xfss_curr_math_size_tl
+\tl_new:N \l_xfss_math_version_tl
+\tl_new:N \l_xfss_default_family_tl
+\tl_new:N \l_xfss_default_series_tl
+\tl_new:N \l_xfss_default_shape_tl
+\tl_new:N \l_xfss_optional_arg_tl
+\tl_new:N \l_xfss_mandatory_arg_tl
+\tl_new:N \l_xfss_external_font_tl
+\tl_new:N \l_xfss_font_info_tl
+\tl_new:N \l_xfss_sizefn_info_tl
 %    \end{macrocode}
 %
 % Used to calculate font sizes and baselineskips automatically:
@@ -952,7 +962,7 @@
 %
 %    \begin{macrocode}
 \tl_new:N \g_xfss_fontface_csname_tl
-\tl_clear:N \LastDeclaredEncoding
+\tl_gclear:N \LastDeclaredEncoding
 \bool_new:N \l_xfss_update_sizes_bool
 \tl_new:N \l_xfss_family_tl
 \tl_new:N \l_xfss_series_tl
@@ -1177,8 +1187,10 @@
         \cs_set_eq:cN {xfss_#1_cmd:NN} \xfss_changed_cmd:NN
 %<package>        \cs_set_eq:cN {#1-cmd} \xfss_changed_cmd:NN
       }
+    \tl_gclear_new:c {g_xfss_encoding_setup_text_ #1 _tl}
     \tl_gset:cn {g_xfss_encoding_setup_text_ #1 _tl}
       { \g_xfss_encoding_setup_text_default_tl #2 }
+    \tl_gclear_new:c {g_xfss_encoding_setup_math_ #1 _tl}
     \tl_gset:cn {g_xfss_encoding_setup_math_ #1 _tl}
       { \g_xfss_encoding_setup_math_default_tl #3 }
     \tl_gset:Nx \LastDeclaredEncoding {#1}
@@ -1226,7 +1238,10 @@
 \DeclareDocumentCommand \DeclareFontFamily {mmm}
   {
     \xfss_encoding_check_exists:nT {#1}
-      { \tl_gset:cn {#1+#2} {#3} }
+      {
+        \tl_gclear_new:c {#1+#2}
+        \tl_gset:cn {#1+#2} {#3}
+      }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1713,7 +1728,8 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\tl_set:Nn \g_xfss_font_submax_tl {0pt}
+\tl_new:N \g_xfss_font_submax_tl
+\tl_gset:Nn \g_xfss_font_submax_tl {0pt}
 \tl_set:Nn \fontsubfuzz{.4pt}
 \cs_new_protected:Npn \xfss_try_simples:w #1 <#2>
   {
@@ -1984,10 +2000,11 @@
 % fixme: what to do in initex?
 %    \begin{macrocode}
 %<*package>
-\tl_set_eq:NN \g_no_accents_tl \noaccents@
+\tl_new:N \l_no_accents_tl
+\tl_set_eq:NN \l_no_accents_tl \noaccents@
 %</package>
 %<*initex>
-\tl_clear:N \g_no_accents_tl
+\tl_new:N \l_no_accents_tl
 %</initex>
 %    \end{macrocode}
 %
@@ -2030,7 +2047,8 @@
 % \end{macro}
 %
 %    \begin{macrocode}
-\tl_set:Nn \g_xfss_global_settings_tl
+\tl_new:N \g_xfss_global_settings_tl
+\tl_gset:Nn \g_xfss_global_settings_tl
   {
     \cs_if_exist:cF { xfss_set_font_size_ \l_xfss_size_tl : }
       { \xfss_calculate_math_sizes: }
@@ -2058,7 +2076,7 @@
          \g_xfss_global_settings_tl
          \xfss_init_restore_glb_settings:
       }
-    \tl_set_eq:NN \g_xfss_curr_math_size_tl \l_xfss_size_tl
+    \tl_set_eq:NN \l_xfss_curr_math_size_tl \l_xfss_size_tl
     \cs_set:Npn \xfss_init_restore_glb_settings: {
       \group_insert_after:N \xfss_restore_glb_settings:
     }
@@ -2070,7 +2088,7 @@
 \cs_new_protected:Npn \xfss_restore_glb_settings:
   {
     \group_begin:
-      \tl_set_eq:NN \l_xfss_size_tl \g_xfss_curr_math_size_tl
+      \tl_set_eq:NN \l_xfss_size_tl \l_xfss_curr_math_size_tl
       \tl_if_eq:NNF \g_xfss_setup_currsize_tl \l_xfss_size_tl
         {\g_xfss_global_settings_tl}
     \group_end:
@@ -2282,6 +2300,7 @@
               }
           }
       }
+    \tl_clear_new:c { \token_to_str:c {#2} \tl_to_str:n {#1-#3} }
     \tl_set:cn { \token_to_str:c {#2} \tl_to_str:n {#1-#3} } {#4}
   }
 \cs_new:Npn \xfss_text_composite:w #1#2#3 \q_nil
@@ -2450,19 +2469,19 @@
 %
 % \subsubsection{Math versions}
 %
-% \begin{variable}{\g_xfss_math_version_seq}
+% \begin{variable}{\l_xfss_math_version_seq}
 %   List of all math versions. Contrarily to \LaTeXe{}'s \cs{version at list},
 %   the items are \texttt{normal} and \texttt{bold} rather than
 %   \cs{mv at normal} and \cs{mv at bold}.
 %    \begin{macrocode}
-\seq_new:N  \g_xfss_math_version_seq
+\seq_new:N  \l_xfss_math_version_seq
 %    \end{macrocode}
 % \end{variable}
 %
 % \begin{macro}{\xfss_math_version_check_exists:nT}
 % \begin{macro}{\xfss_math_version_if_exist:nTF}
 %   Error if the math version does not exist.
-%   Should it use \cs{seq_if_in:Nn} \cs{g_xfss_math_version_seq}?
+%   Should it use \cs{seq_if_in:Nn} \cs{l_xfss_math_version_seq}?
 %    \begin{macrocode}
 \cs_new_protected:Npn \xfss_math_version_check_exists:nT #1 #2
   {
@@ -2561,7 +2580,7 @@
       { \msg_info:nnxx {xfss} {redeclaring} {math~version} {#1} }
       {
         \int_new:c {g_xfss_mversion_ #1 _int}
-        \seq_put_right:Nn \g_xfss_math_version_seq {#1}
+        \seq_put_right:Nn \l_xfss_math_version_seq {#1}
       }
     \int_gset:cn { g_xfss_mversion_ #1 _int }
       { \prop_count:N \g_xfss_symbol_font_prop }
@@ -2609,7 +2628,7 @@
           {
             \msg_info:nnxx {xfss} {redeclaring} {symbol~font} {#1}
             \prop_gput:Nxx \g_xfss_symbol_font_prop {#1} { #2 / #3 / #4 / #5 }
-            \seq_map_inline:Nn \g_xfss_math_version_seq
+            \seq_map_inline:Nn \l_xfss_math_version_seq
               {
                 \exp_args:Nc \xfss_set_symbol_font:Nnn
                   {#2/#3/#4/#5} {#1} {##1}
@@ -2624,7 +2643,7 @@
 \cs_new_protected:Npn \xfss_new_symbol_font:nnnnn #1#2#3#4#5
   {
     \prop_gput:Nxx \g_xfss_symbol_font_prop {#1} { #2 / #3 / #4 / #5 }
-    \seq_map_inline:Nn \g_xfss_math_version_seq
+    \seq_map_inline:Nn \l_xfss_math_version_seq
       {
         \prop_gput:cxx { g_xfss_math_version_ ##1 _gdf_prop }
           { \int_use:c {sym#1} } { \exp_not:c {#2/#3/#4/#5} }
@@ -2714,7 +2733,7 @@
               {
                 \msg_info:nnxx {xfss}
                   {redeclaring} {math~alphabet} { \token_to_str:N #1 }
-                \seq_map_inline:Nn \g_xfss_math_version_seq
+                \seq_map_inline:Nn \l_xfss_math_version_seq
                   {
                     \xfss_set_math_alphabet:Nnnn
                       #1
@@ -2766,7 +2785,7 @@
             \exp_not:c {#2/#3/#4/#5}
           }
       }
-    \seq_map_inline:Nn \g_xfss_math_version_seq
+    \seq_map_inline:Nn \l_xfss_math_version_seq
       {
         \prop_gput:cxx { g_xfss_math_version_ ##1 _ins_prop }
           { \cs_to_str:N #1 } { \exp_not:o {#1} }
@@ -2836,7 +2855,7 @@
         \tl_set:Nn \l_xfss_tmpc_tl {##2}
       }
     \exp_after:wN \xfss_tmp:w #1
-    \seq_map_inline:Nn \g_xfss_math_version_seq
+    \seq_map_inline:Nn \l_xfss_math_version_seq
       {
         \prop_get:cxNT { g_xfss_math_version_ ##1 _gdf_prop }
           { \int_eval:n { \l_xfss_tmpb_tl } } %^^A overkill
@@ -2888,7 +2907,7 @@
           {
             \msg_info:nnxx {xfss}
               {redeclaring} {math~alphabet} { \token_to_str:N #1 }
-            \seq_map_inline:Nn \g_xfss_math_version_seq
+            \seq_map_inline:Nn \l_xfss_math_version_seq
               {
                 \prop_gpop:cxN { g_xfss_math_version_ ##1 _ins_prop }
                   { \cs_to_str:N #1 } \l_xfss_tmpb_tl
@@ -3449,10 +3468,13 @@
 %
 %    \begin{macrocode}
 \tl_set:Nn \glb at settings {\g_xfss_global_settings_tl}
+\tl_new:N \tf at size
 \tl_set:Nn \tf at size  {\g_xfss_tf_size_tl}
+\tl_new:N \sf at size
 \tl_set:Nn \sf at size  {\g_xfss_sf_size_tl}
+\tl_new:N \ssf at size
 \tl_set:Nn \ssf at size {\g_xfss_ssf_size_tl}
-\tl_set:Nn \noaccents@ {\g_no_accents_tl}
+\tl_set:Nn \noaccents@ {\l_no_accents_tl}
 %    \end{macrocode}
 %
 %    \begin{macrocode}





More information about the latex3-commits mailing list