OSDN Git Service

Bugfix of the previous commit.
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Tue, 22 Nov 2011 03:49:58 +0000 (12:49 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Tue, 22 Nov 2011 03:49:58 +0000 (12:49 +0900)
src/luatexja-core.sty
src/patches/lltjp-unicode-math.sty

index 666a6fe..b0233cc 100644 (file)
 \def\zw{\directlua{luatexja.jfont.load_zw()}\ltj@zw}
 \def\zh{\directlua{luatexja.jfont.load_zh()}\ltj@zh}
 
+
 %%%%%%%% \inhibitglue
+\protected\def\ltj@reset@globaldefs{%
+  \directlua{ltj.global_temp = tex.globaldefs; tex.globaldefs = 0}}
+\protected\def\ltj@restore@globaldefs{\directlua{tex.globaldefs = ltj.global_temp}}
 \let\new@everypar=\everypar
 \protected\def\inhibitglue{\relax%
   \ifvmode
-    \directlua{ltj.global_temp = tex.globaldefs; tex.globaldefs = 0}% trick
+    \ltj@reset@globaldefs
     \xdef\@@tempa{\the\everypar}%
     \xdef\@@tempb{\everypar={\@@tempa}\@@tempa\noexpand\ltj@@ihb}%
     \everypar\expandafter{\@@tempb}%
-    \directlua{tex.globaldefs = ltj.global_temp}% trick
+    \ltj@restore@globaldefs
   \else\ifhmode\ltj@@ihb\fi\fi}
 \def\ltj@@ihb{\directlua{luatexja.jfmglue.create_inhibitglue_node()}}
 
 \define@key[ltj]{japaram}{jascriptscriptfont}{%
   \expandafter\ltj@@set@stackfont#1:{mjss}}
 \def\ltj@@set@stackfont#1,#2:#3{%
-  \directlua{%
-    ltj.global_temp = tex.globaldefs; 
-    tex.globaldefs = 0}%
+  \ltj@reset@globaldefs
   \ltj@tempcnta=\ltj@curjfnt\ltj@curjfnt=-1 #2%
   \ifnum\ltj@curjfnt=-1
     \@PackageError{luatexja-core}%
     \ltj@safe@num@or\ltj@defnum{#1}, \the\ltj@curjfnt)}%
   \fi
   \ltj@curjfnt=\ltj@tempcnta
-  \directlua{tex.globaldefs = ltj.global_temp}%
+  \ltj@restore@globaldefs
   }
 
 % yalbaselineshift = <dimen>
     \csname ltj@kcat4\endcsname="7FFFFFFF %"
     \csname ltj@kcat5\endcsname="7FFFFFFF %"
     \csname ltj@kcat6\endcsname="7FFFFFFF }%"
-\protected\def\ltj@backup@kcat{\edef\ltj@restore@kcat{%
-    \csname ltj@kcat0\endcsname=\expandafter\the\csname ltj@kcat0\endcsname\relax
-    \csname ltj@kcat1\endcsname=\expandafter\the\csname ltj@kcat1\endcsname\relax
-    \csname ltj@kcat2\endcsname=\expandafter\the\csname ltj@kcat2\endcsname\relax
-    \csname ltj@kcat3\endcsname=\expandafter\the\csname ltj@kcat3\endcsname\relax
-    \csname ltj@kcat4\endcsname=\expandafter\the\csname ltj@kcat4\endcsname\relax
-    \csname ltj@kcat5\endcsname=\expandafter\the\csname ltj@kcat5\endcsname\relax
-    \csname ltj@kcat6\endcsname=\expandafter\the\csname ltj@kcat6\endcsname\relax}}
-\let\ltj@restore@kcat=\relax
 
 \protected\def\ltjjachar{\afterassignment\ltj@@kchar\ltj@tempcnta}
 \def\ltj@@kchar{{\directlua{tex.globaldefs = 0}\ltj@alljachar\ltj@@origchar\ltj@tempcnta}}
index ff8ad2d..beb3261 100644 (file)
   \directlua{luatexja.math.is_math_letters[\int_eval:n {#4}]=true}
 }
 \group_begin:
-  \char_set_catcode_other:N \^
-  \gdef\q{hoge}\gdef\r{piyo}
   \cs_gset:Npn \um_cs_set_eq_active_char:Nw #1 = "#2 \q_nil {%"
-    \tl_set:Nn \l_tmpa_tl {\ifmmode\char"#2\else\ltjalchar"#2\relax\fi}
-    \cs_gset_eq:NN #1 \l_tmpa_tl
+    \group_begin:
+      \char_set_lccode:nn { `! } { "#2 }
+      \tex_lowercase:D {
+        \tl_set:Nn \l_tmpa_tl {\ifmmode!\else{\directlua{tex.globaldefs = 0}\ltj@allalchar!}\fi}
+        \cs_gset_eq:NN #1 \l_tmpa_tl
+      }
+    \group_end:
   }
 \group_end: