From 7eaec35c0b4f23c0683b27965c5c06244abe28fd Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Thu, 6 Aug 2015 22:00:40 +0000
Subject: unicode-math (6aug15)

git-svn-id: svn://tug.org/texlive/trunk@38063 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/latex/unicode-math/unicode-math-luatex.sty | 51 +++++++++++-----------
 1 file changed, 26 insertions(+), 25 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty')

diff --git a/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty
index 8755025b92f..1866de6a515 100644
--- a/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty
+++ b/Master/texmf-dist/tex/latex/unicode-math/unicode-math-luatex.sty
@@ -39,7 +39,11 @@
  }
 \cs_set:Nn \__um_set_mathsymbol:nNNn
  {
-  \int_compare:nT { \char_value_catcode:n {#4} == 11 }
+  \bool_if:nT
+   {
+    \int_compare_p:nNn {#4} > {127} &&
+    \int_compare_p:nNn { \char_value_catcode:n {#4} } = {11}
+   }
    { \char_set_catcode_other:n {#4} }
 
   \tl_case:Nn #3
@@ -243,9 +247,7 @@
   \keys_set_known:nnN {unicode-math} {#1,#3} \l__um_unknown_keys_clist
   \bool_if:NT \l__um_init_bool { \__um_log:n {default-math-font} }
 
-  \csname TIC\endcsname
   \__um_fontspec_select_font:
-  \csname TOC\endcsname
   \bool_if:nT { \l__um_ot_math_bool && !\g__um_mainfont_already_set_bool }
    {
     \__um_declare_math_sizes:
@@ -270,15 +272,11 @@
     \__um_setup_legacy_fam_two:
     \__um_setup_legacy_fam_three:
    }
-  \csname TIC\endcsname
   \__um_input_math_symbol_table:
-  \csname TOC\endcsname
   \__um_remap_symbols:
   \__um_setup_mathactives:
   \__um_setup_delcodes:
-  \csname TIC\endcsname
   \__um_setup_alphabets:
-  \csname TOC\endcsname
   \__um_setup_negations:
   \ignorespaces
  }
@@ -830,7 +828,10 @@
 
   \cs_new:cn { __um_config_#1_#2:n } {#3}
  }
-\cs_new:Nn \__um_alphabet_config:nnn { \use:c {__um_config_#1_#2:n} {#3} }
+\cs_new:Nn \__um_alphabet_config:nnn
+ {
+  \use:c {__um_config_#1_#2:n} {#3}
+ }
 \prg_new_conditional:Nnn \__um_if_alphabet_exists:nn {T,TF}
  {
   \cs_if_exist:cTF {__um_config_#1_#2:n}
@@ -840,6 +841,7 @@
  {
   \seq_put_right:Nx \g__um_named_ranges_seq { \tl_to_str:n {#1} }
   \seq_put_right:Nn \g__um_default_mathalph_seq {{#1}{#2}{#3}}
+  \prop_gput:cnn { g__um_named_range_#1_prop } { default-alpha } {#2}
  }
 \__um_default_mathalph:nnn {up    } {latin,Latin,greek,Greek,num,misc} {up    }
 \__um_default_mathalph:nnn {it    } {latin,Latin,greek,Greek,misc}     {it    }
@@ -911,27 +913,29 @@
     \cs_set_eq:NN \__um_set_mathalphabet_char:nnn \__um_mathmap_noparse:nnn
     \cs_set_eq:NN \__um_map_char_single:nn \__um_map_char_noparse:nn
    }
+
+  % Now perform the mapping:
   \seq_map_inline:Nn \l__um_mathalph_seq
    {
-    \tl_set:No \l__um_style_tl          { \use_i:nnn   ##1 }
+    \tl_set:No    \l__um_style_tl       { \use_i:nnn   ##1 }
     \clist_set:No \l__um_alphabet_clist { \use_ii:nnn  ##1 }
-    \tl_set:No \l__um_remap_style_tl    { \use_iii:nnn ##1 }
+    \tl_set:No    \l__um_remap_style_tl { \use_iii:nnn ##1 }
 
+    % If no set of alphabets is defined:
     \clist_if_empty:NT \l__um_alphabet_clist
      {
       \cs_set_eq:NN \__um_maybe_init_alphabet:n \__um_init_alphabet:n
-      \clist_set:Nn \l__um_alphabet_clist { latin, Latin, greek, Greek, num, misc }
+      \prop_get:cnN { g__um_named_range_ \l__um_style_tl _prop }
+       { default-alpha } \l__um_alphabet_clist
      }
 
-    \__um_setup_math_alphabet:NNN
-      \l__um_style_tl \l__um_alphabet_clist \l__um_remap_style_tl
+    \__um_setup_math_alphabet:
    }
   \seq_if_empty:NF \l__um_missing_alph_seq { \__um_log:n { missing-alphabets } }
  }
-\cs_new:Nn \__um_setup_math_alphabet:NNN
+\cs_new:Nn \__um_setup_math_alphabet:
  {
-  \tl_set_eq:NN \l__um_style_tl #1% actually a no-op but makes the code clearer!
-  \clist_map_inline:Nn #2
+  \clist_map_inline:Nn \l__um_alphabet_clist
    {
     \tl_set:Nn \l__um_alphabet_tl {##1}
     \__um_if_alphabet_exists:nnTF \l__um_style_tl \l__um_alphabet_tl
@@ -951,22 +955,21 @@
      }
      { \msg_warning:nnx {unicode-math} {no-alphabet} { \l__um_style_tl / \l__um_alphabet_tl } }
    }
-  \csname TIC\endcsname
-  \clist_map_inline:Nn #2
+  \clist_map_inline:Nn \l__um_alphabet_clist
    {
     \tl_set:Nx \l__um_alphabet_tl { \tl_trim_spaces:n {##1} }
     \cs_if_exist:cT {__um_config_ \l__um_style_tl _ \l__um_alphabet_tl :n}
      {
       \exp_args:No \tl_if_eq:nnTF \l__um_alphabet_tl {misc}
        {
-        \__um_log:nx {setup-alph} {math \l__um_style_tl~(\l__um_alphabet_tl)}
-        \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {#3}
+        \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
+        \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
        }
        {
-        \__um_glyph_if_exist:nTF { \__um_to_usv:nn {\l__um_style_tl} {\l__um_alphabet_tl} }
+        \__um_glyph_if_exist:nTF { \__um_to_usv:nn {\l__um_remap_style_tl} {\l__um_alphabet_tl} }
          {
-          \__um_log:nx {setup-alph} {math \l__um_style_tl~(\l__um_alphabet_tl)}
-          \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {#3}
+          \__um_log:nx {setup-alph} {sym \l__um_style_tl~(\l__um_alphabet_tl)}
+          \__um_alphabet_config:nnn {\l__um_style_tl} {\l__um_alphabet_tl} {\l__um_remap_style_tl}
          }
          {
           \bool_if:NTF \l__um_implicit_alph_bool
@@ -984,7 +987,6 @@
        }
      }
    }
-  \csname TOC\endcsname
  }
 \cs_new:Nn \__um_map_char_noparse:nn
  { \__um_set_mathcode:nnnn {#1}{\mathalpha}{\__um_symfont_tl}{#2} }
@@ -1748,7 +1750,6 @@
     \bool_if:NTF \g__um_literal_colon_bool {:} { \mathpunct{:} }
    }
  }
-\let\mathfence\mathord
 \def\digamma{\updigamma}
 \def\Digamma{\upDigamma}
 \cs_set:Npn \| {\Vert}
-- 
cgit v1.2.3

