texlive[42133] Build/source/texk/web2c/luatexdir: luatexdir: sync

commits+kakuto at tug.org commits+kakuto at tug.org
Fri Sep 23 14:35:11 CEST 2016


Revision: 42133
          http://tug.org/svn/texlive?view=revision&revision=42133
Author:   kakuto
Date:     2016-09-23 14:35:11 +0200 (Fri, 23 Sep 2016)
Log Message:
-----------
luatexdir: sync with the upstream

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/luatexdir/font/texfont.w
    trunk/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
    trunk/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
    trunk/Build/source/texk/web2c/luatexdir/lua/luanode.w
    trunk/Build/source/texk/web2c/luatexdir/luatex.c
    trunk/Build/source/texk/web2c/luatexdir/luatexcallbackids.h
    trunk/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h
    trunk/Build/source/texk/web2c/luatexdir/pdf/pdfliteral.w
    trunk/Build/source/texk/web2c/luatexdir/pdf/pdfrule.w
    trunk/Build/source/texk/web2c/luatexdir/tex/commands.w
    trunk/Build/source/texk/web2c/luatexdir/tex/dumpdata.w
    trunk/Build/source/texk/web2c/luatexdir/tex/equivalents.h
    trunk/Build/source/texk/web2c/luatexdir/tex/errors.w
    trunk/Build/source/texk/web2c/luatexdir/tex/extensions.w
    trunk/Build/source/texk/web2c/luatexdir/tex/mlist.w
    trunk/Build/source/texk/web2c/luatexdir/tex/texfileio.w
    trunk/Build/source/texk/web2c/luatexdir/tex/texnodes.h
    trunk/Build/source/texk/web2c/luatexdir/tex/texnodes.w
    trunk/Build/source/texk/web2c/luatexdir/tex/textoken.w

Modified: trunk/Build/source/texk/web2c/luatexdir/font/texfont.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/font/texfont.w	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/font/texfont.w	2016-09-23 12:35:11 UTC (rev 42133)
@@ -267,18 +267,25 @@
     x = ci->top_left_math_kerns;
     co->top_left_math_kerns = x;
     if (x > 0) {
-        co->top_left_math_kern_array =
-            xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
+        co->top_left_math_kern_array = xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
         for (k = 0; k < co->top_left_math_kerns; k++) {
             co->top_left_math_kern_array[(2 * k)] = ci->top_left_math_kern_array[(2 * k)];
             co->top_left_math_kern_array[(2 * k) + 1] = ci->top_left_math_kern_array[(2 * k) + 1];
         }
     }
+    x = ci->bottom_left_math_kerns;
+    co->bottom_left_math_kerns = x;
+    if (x > 0) {
+        co->bottom_left_math_kern_array = xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
+        for (k = 0; k < co->bottom_left_math_kerns; k++) {
+            co->bottom_left_math_kern_array[(2 * k)] = ci->bottom_left_math_kern_array[(2 * k)];
+            co->bottom_left_math_kern_array[(2 * k) + 1] = ci->bottom_left_math_kern_array[(2 * k) + 1];
+        }
+    }
     x = ci->top_right_math_kerns;
     co->top_right_math_kerns = x;
     if (x > 0) {
-        co->top_right_math_kern_array =
-            xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
+        co->top_right_math_kern_array = xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
         for (k = 0; k < co->top_right_math_kerns; k++) {
             co->top_right_math_kern_array[(2 * k)] = ci->top_right_math_kern_array[(2 * k)];
             co->top_right_math_kern_array[(2 * k) + 1] = ci->top_right_math_kern_array[(2 * k) + 1];
@@ -287,23 +294,12 @@
     x = ci->bottom_right_math_kerns;
     co->bottom_right_math_kerns = x;
     if (x > 0) {
-        co->bottom_right_math_kern_array =
-            xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
+        co->bottom_right_math_kern_array = xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
         for (k = 0; k < co->bottom_right_math_kerns; k++) {
             co->bottom_right_math_kern_array[(2 * k)] = ci->bottom_right_math_kern_array[(2 * k)];
             co->bottom_right_math_kern_array[(2 * k) + 1] = ci->bottom_right_math_kern_array[(2 * k) + 1];
         }
     }
-    x = ci->bottom_left_math_kerns;
-    co->bottom_left_math_kerns = x;
-    if (x > 0) {
-        co->bottom_left_math_kern_array =
-            xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
-        for (k = 0; k < co->bottom_left_math_kerns; k++) {
-            co->bottom_left_math_kern_array[(2 * k)] = ci->bottom_left_math_kern_array[(2 * k)];
-            co->bottom_left_math_kern_array[(2 * k) + 1] = ci->bottom_left_math_kern_array[(2 * k) + 1];
-        }
-    }
     return co;
 }
 
@@ -652,10 +648,10 @@
         k = ci->top_left_math_kerns;
     } else if (id == bottom_left_kern) {
         k = ci->bottom_left_math_kerns;
+    } else if (id == top_right_kern) {
+        k = ci->top_right_math_kerns;
     } else if (id == bottom_right_kern) {
         k = ci->bottom_right_math_kerns;
-    } else if (id == top_right_kern) {
-        k = ci->top_right_math_kerns;
     } else {
         confusion("get_charinfo_math_kerns");
     }
@@ -674,25 +670,22 @@
         ci->top_left_math_kerns++;
     } else if (id == bottom_left_kern) {
         k = ci->bottom_left_math_kerns;
-        do_realloc(ci->bottom_left_math_kern_array, ((k + 1) * 2),
-                   sizeof(scaled));
+        do_realloc(ci->bottom_left_math_kern_array, ((k + 1) * 2), sizeof(scaled));
         ci->bottom_left_math_kern_array[(2 * (k))] = ht;
         ci->bottom_left_math_kern_array[(2 * (k)) + 1] = krn;
         ci->bottom_left_math_kerns++;
+    } else if (id == top_right_kern) {
+        k = ci->top_right_math_kerns;
+        do_realloc(ci->top_right_math_kern_array, ((k + 1) * 2), sizeof(scaled));
+        ci->top_right_math_kern_array[(2 * (k))] = ht;
+        ci->top_right_math_kern_array[(2 * (k)) + 1] = krn;
+        ci->top_right_math_kerns++;
     } else if (id == bottom_right_kern) {
         k = ci->bottom_right_math_kerns;
-        do_realloc(ci->bottom_right_math_kern_array, ((k + 1) * 2),
-                   sizeof(scaled));
+        do_realloc(ci->bottom_right_math_kern_array, ((k + 1) * 2), sizeof(scaled));
         ci->bottom_right_math_kern_array[(2 * (k))] = ht;
         ci->bottom_right_math_kern_array[(2 * (k)) + 1] = krn;
         ci->bottom_right_math_kerns++;
-    } else if (id == top_right_kern) {
-        k = ci->top_right_math_kerns;
-        do_realloc(ci->top_right_math_kern_array, ((k + 1) * 2),
-                   sizeof(scaled));
-        ci->top_right_math_kern_array[(2 * (k))] = ht;
-        ci->top_right_math_kern_array[(2 * (k)) + 1] = krn;
-        ci->top_right_math_kerns++;
     } else {
         confusion("add_charinfo_math_kern");
     }
@@ -715,6 +708,12 @@
         dump_int(ci->bottom_left_math_kern_array[(2 * k)]);
         dump_int(ci->bottom_left_math_kern_array[(2 * k) + 1]);
     }
+    l = ci->top_right_math_kerns;
+    dump_int(l);
+    for (k = 0; k < l; k++) {
+        dump_int(ci->top_right_math_kern_array[(2 * k)]);
+        dump_int(ci->top_right_math_kern_array[(2 * k) + 1]);
+    }
     l = ci->bottom_right_math_kerns;
     dump_int(l);
     for (k = 0; k < l; k++) {
@@ -721,12 +720,6 @@
         dump_int(ci->bottom_right_math_kern_array[(2 * k)]);
         dump_int(ci->bottom_right_math_kern_array[(2 * k) + 1]);
     }
-    l = ci->top_right_math_kerns;
-    dump_int(l);
-    for (k = 0; k < l; k++) {
-        dump_int(ci->bottom_left_math_kern_array[(2 * k)]);
-        dump_int(ci->bottom_left_math_kern_array[(2 * k) + 1]);
-    }
 }
 
 @ @c
@@ -737,8 +730,7 @@
     undump_int(x);
     ci->top_left_math_kerns = x;
     if (x > 0)
-        ci->top_left_math_kern_array =
-            xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
+        ci->top_left_math_kern_array = xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
     for (k = 0; k < ci->top_left_math_kerns; k++) {
         undump_int(x);
         ci->top_left_math_kern_array[(2 * k)] = (scaled) x;
@@ -748,8 +740,7 @@
     undump_int(x);
     ci->bottom_left_math_kerns = x;
     if (x > 0)
-        ci->bottom_left_math_kern_array =
-            xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
+        ci->bottom_left_math_kern_array = xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
     for (k = 0; k < ci->bottom_left_math_kerns; k++) {
         undump_int(x);
         ci->bottom_left_math_kern_array[(2 * k)] = (scaled) x;
@@ -757,26 +748,24 @@
         ci->bottom_left_math_kern_array[(2 * k) + 1] = (scaled) x;
     }
     undump_int(x);
-    ci->bottom_right_math_kerns = x;
+    ci->top_right_math_kerns = x;
     if (x > 0)
-        ci->bottom_right_math_kern_array =
-            xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
-    for (k = 0; k < ci->bottom_right_math_kerns; k++) {
+        ci->top_right_math_kern_array = xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
+    for (k = 0; k < ci->top_right_math_kerns; k++) {
         undump_int(x);
-        ci->bottom_right_math_kern_array[(2 * k)] = (scaled) x;
+        ci->top_right_math_kern_array[(2 * k)] = (scaled) x;
         undump_int(x);
-        ci->bottom_right_math_kern_array[(2 * k) + 1] = (scaled) x;
+        ci->top_right_math_kern_array[(2 * k) + 1] = (scaled) x;
     }
     undump_int(x);
-    ci->top_right_math_kerns = x;
+    ci->bottom_right_math_kerns = x;
     if (x > 0)
-        ci->top_right_math_kern_array =
-            xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
-    for (k = 0; k < ci->top_right_math_kerns; k++) {
+        ci->bottom_right_math_kern_array = xmalloc((unsigned) (2 * (int) sizeof(scaled) * x));
+    for (k = 0; k < ci->bottom_right_math_kerns; k++) {
         undump_int(x);
-        ci->top_right_math_kern_array[(2 * k)] = (scaled) x;
+        ci->bottom_right_math_kern_array[(2 * k)] = (scaled) x;
         undump_int(x);
-        ci->top_right_math_kern_array[(2 * k) + 1] = (scaled) x;
+        ci->bottom_right_math_kern_array[(2 * k) + 1] = (scaled) x;
     }
 }
 

Modified: trunk/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c	2016-09-23 12:35:11 UTC (rev 42133)
@@ -72,6 +72,7 @@
     "process_rule",
     "insert_local_par",
     "contribute_filter",
+    "call_edit",
     NULL
 };
 

Modified: trunk/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/lua/lpdflib.c	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/lua/lpdflib.c	2016-09-23 12:35:11 UTC (rev 42133)
@@ -43,6 +43,8 @@
                 literal_mode = direct_always;
             else if (lua_key_eq(modestr_s,page))
                 literal_mode = direct_page;
+            else if (lua_key_eq(modestr_s,raw))
+                literal_mode = direct_raw;
             else {
                 luaL_error(L, "invalid first argument for print literal mode");
             }
@@ -64,6 +66,9 @@
         case (direct_always):
             pdf_end_string_nl(static_pdf);
             break;
+        case (direct_raw):
+            pdf_end_string_nl(static_pdf);
+            break;
         default:
             assert(0);
     }
@@ -1069,11 +1074,13 @@
     if (lua_type(L,2) == LUA_TSTRING) {
         l =	lua_tostring(L, 2);
         if (lua_key_eq(l,origin)) {
-            literal_mode = 0;
+            literal_mode = set_origin;
         } else if (lua_key_eq(l,page))  {
-            literal_mode = 1; /* direct_page */
+            literal_mode = direct_page;
         } else if (lua_key_eq(l,direct)) {
-            literal_mode = 2; /* direct_always */
+            literal_mode = direct_always;
+        } else if (lua_key_eq(l,raw)) {
+            literal_mode = direct_raw;
         } else {
             luaL_error(L, "invalid literal mode in pdf.newcolorstack()");
         }

Modified: trunk/Build/source/texk/web2c/luatexdir/lua/luanode.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/lua/luanode.w	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/lua/luanode.w	2016-09-23 12:35:11 UTC (rev 42133)
@@ -420,6 +420,9 @@
         case direct_always:
             tprint(" direct");
             break;
+        case direct_raw:
+            tprint(" raw");
+            break;
         default:
             confusion("literal2");
             break;

Modified: trunk/Build/source/texk/web2c/luatexdir/luatex.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/luatex.c	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/luatex.c	2016-09-23 12:35:11 UTC (rev 42133)
@@ -28,10 +28,10 @@
 
 #define TeX
 
-int luatex_version = 98;        /* \.{\\luatexversion}  */
-int luatex_revision = '4';      /* \.{\\luatexrevision}  */
-int luatex_date_info = 2016090500;     /* the compile date is now hardwired */
-const char *luatex_version_string = "0.98.4";
+int luatex_version = 99;        /* \.{\\luatexversion}  */
+int luatex_revision = '5';      /* \.{\\luatexrevision}  */
+int luatex_date_info = 2016092300;     /* the compile date is now hardwired */
+const char *luatex_version_string = "0.99.5";
 const char *engine_name = my_name;     /* the name of this engine */
 
 #include <kpathsea/c-ctype.h>
@@ -61,10 +61,6 @@
 #include <signal.h>             /* Catch interrupts.  */
 
 
-/* {tex,mf}d.h defines TeX, MF, INI, and other such symbols.
-   Unfortunately there's no way to get the banner into this code, so
-   just repeat the text.  */
-#define edit_var "TEXEDIT"
 

 /* Shell escape.
 

Modified: trunk/Build/source/texk/web2c/luatexdir/luatexcallbackids.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/luatexcallbackids.h	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/luatexcallbackids.h	2016-09-23 12:35:11 UTC (rev 42133)
@@ -66,6 +66,7 @@
     process_rule_callback,
     insert_local_par_callback,
     contribute_filter_callback,
+    call_edit_callback,
     total_callbacks
 } callback_callback_types;
 

Modified: trunk/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h	2016-09-23 12:35:11 UTC (rev 42133)
@@ -27,8 +27,8 @@
 #  define PROCSET_IMAGE_C (1 << 3)
 #  define PROCSET_IMAGE_I (1 << 4)
 
-#  define inf_pdf_mem_size    10000 /* min size of the |mem| array */
-#  define sup_pdf_mem_size 10000000 /* max size of the |mem| array */
+#  define inf_pdf_mem_size     10000 /* min size of the |mem| array */
+#  define sup_pdf_mem_size 100000000 /* max size of the |mem| array */
 
 extern PDF static_pdf;
 
@@ -43,10 +43,10 @@
 
 */
 
-#  define inf_pdfout_buf_size   16384  /* initial value of |pdf->buf| size */
-#  define sup_pdfout_buf_size   16384  /* arbitrary upper hard limit of |pdf->buf| size */
-#  define inf_objstm_buf_size       1  /* initial value of |os->buf[OBJSTM_BUF]| size */
-#  define sup_objstm_buf_size 5000000  /* arbitrary upper hard limit of |os->buf[OBJSTM_BUF]| size */
+#  define inf_pdfout_buf_size     16384 /* initial value of |pdf->buf| size */
+#  define sup_pdfout_buf_size   8*16384 /* arbitrary upper hard limit of |pdf->buf| size */
+#  define inf_objstm_buf_size         1 /* initial value of |os->buf[OBJSTM_BUF]| size */
+#  define sup_objstm_buf_size   5000000 /* arbitrary upper hard limit of |os->buf[OBJSTM_BUF]| size */
 
 #  define PDF_OS_MAX_OBJS         100  /* maximum number of objects in object stream */
 

Modified: trunk/Build/source/texk/web2c/luatexdir/pdf/pdfliteral.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/pdf/pdfliteral.w	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/pdf/pdfliteral.w	2016-09-23 12:35:11 UTC (rev 42133)
@@ -66,6 +66,9 @@
                 pdf_end_string_nl(pdf);
                 ps->need_tm = true;
                 break;
+            case direct_raw:
+                pdf_end_string_nl(pdf);
+                break;
             default:
                 normal_error("pdf backend","bad literal mode");
                 break;
@@ -114,6 +117,9 @@
             } else if (str_in_cstr(s, "page:", strlen("PDF:"))) {
                 j = j + (pool_pointer) strlen("page:");
                 literal_mode = direct_page;
+            } else if (str_in_cstr(s, "raw:", strlen("PDF:"))) {
+                j = j + (pool_pointer) strlen("raw:");
+                literal_mode = direct_raw;
             } else {
                 literal_mode = set_origin;
             }
@@ -131,6 +137,9 @@
             pdf_end_string_nl(pdf);
             p->need_tm = true;
             break;
+        case direct_raw:
+            pdf_end_string_nl(pdf);
+            break;
         default:
             normal_error("pdf backend","bad literal mode");
             break;

Modified: trunk/Build/source/texk/web2c/luatexdir/pdf/pdfrule.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/pdf/pdfrule.w	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/pdf/pdfrule.w	2016-09-23 12:35:11 UTC (rev 42133)
@@ -30,14 +30,22 @@
     pdfpos dim;
     pdfstructure *p = pdf->pstruct;
     scaledpos pos = pdf->posstruct->pos;
+    halfword s = subtype(q);
     /*  (void) q; */
-    if (subtype(q) == box_rule) {
+    if (s >= math_over_rule && s <= math_radical_rule) {
+        if (callback_id == 0) {
+            s = normal_rule;
+        } else {
+            s = user_rule;
+        }
+    }
+    if (s == box_rule) {
         pdf_place_form(pdf,q);
-    } else if (subtype(q) == image_rule) {
+    } else if (s == image_rule) {
         pdf_place_image(pdf,q);
-    } else if (subtype(q) == empty_rule) {
+    } else if (s == empty_rule) {
         /* place nothing, only take space */
-    } else if (subtype(q) == user_rule) {
+    } else if (s == user_rule) {
         if (callback_id != 0) {
             pdf_goto_pagemode(pdf);
             pdf_puts(pdf, "q\n");

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/commands.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/commands.w	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/commands.w	2016-09-23 12:35:11 UTC (rev 42133)
@@ -754,6 +754,8 @@
     primitive_luatex("mathdisplayskipmode", assign_int_cmd, int_base + math_display_skip_mode_code, int_base);
     primitive_luatex("mathscriptsmode", assign_int_cmd, int_base + math_scripts_mode_code, int_base);
     primitive_luatex("mathnolimitsmode", assign_int_cmd, int_base + math_nolimits_mode_code, int_base);
+    primitive_luatex("mathrulesmode", assign_int_cmd, int_base + math_rules_mode_code, int_base);
+    primitive_luatex("mathrulesfam", assign_int_cmd, int_base + math_rules_fam_code, int_base);
     primitive_luatex("synctex", assign_int_cmd, int_base + synctex_code, int_base);
 
     primitive_etex("currentgrouplevel", last_item_cmd, current_group_level_code, 0);

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/dumpdata.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/dumpdata.w	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/dumpdata.w	2016-09-23 12:35:11 UTC (rev 42133)
@@ -23,7 +23,7 @@
 
 /* we start with 907: the sum of the values of the bytes of "don knuth" */
 
-#define FORMAT_ID (907+18)
+#define FORMAT_ID (907+20)
 #if ((FORMAT_ID>=0) && (FORMAT_ID<=256))
 #error Wrong value for FORMAT_ID.
 #endif

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/equivalents.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/equivalents.h	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/equivalents.h	2016-09-23 12:35:11 UTC (rev 42133)
@@ -279,20 +279,22 @@
 #  define math_display_skip_mode_code 88
 #  define math_scripts_mode_code 89
 #  define math_nolimits_mode_code 90
-#  define synctex_code 91                                               /* is synctex file generation enabled ?  */
-#  define shape_mode_code 92
-#  define first_valid_language_code 93
-#  define hyphenation_bounds_code 94
+#  define math_rules_mode_code 91
+#  define math_rules_fam_code 92
+#  define synctex_code 93                                               /* is synctex file generation enabled ?  */
+#  define shape_mode_code 94
+#  define first_valid_language_code 95
+#  define hyphenation_bounds_code 96
 
-#  define math_option_code 95
+#  define math_option_code 97
 
-#  define mathoption_int_base (int_base+96)                             /* one reserve */
-#  define mathoption_int_last (int_base+104)
+#  define mathoption_int_base (int_base+98)                             /* one reserve */
+#  define mathoption_int_last (int_base+106)
 
-#  define backend_int_base (int_base+105)
-#  define backend_int_last (int_base+129)
+#  define backend_int_base (int_base+107)
+#  define backend_int_last (int_base+131)
 
-#  define tex_int_pars (130)                                            /* total number of integer parameters */
+#  define tex_int_pars (132)                                            /* total number of integer parameters */
 
 #  define page_direction_code (tex_int_pars)
 #  define body_direction_code (tex_int_pars+1)
@@ -639,6 +641,8 @@
 #define disable_space_par                  int_par(disable_space_code)
 #define scripts_mode_par                   int_par(math_scripts_mode_code)
 #define nolimits_mode_par                  int_par(math_nolimits_mode_code)
+#define math_rules_mode_par                int_par(math_rules_mode_code)
+#define math_rules_fam_par                 int_par(math_rules_fam_code)
 
 #define thin_mu_skip_par                   glue_par(thin_mu_skip_code)
 #define med_mu_skip_par                    glue_par(med_mu_skip_code)

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/errors.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/errors.w	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/errors.w	2016-09-23 12:35:11 UTC (rev 42133)
@@ -24,6 +24,7 @@
 
 @ @c
 #include "ptexlib.h"
+#define edit_var "TEXEDIT"
 
 @ When something anomalous is detected, \TeX\ typically does something like this:
 $$\vbox{\halign{#\hfil\cr
@@ -232,7 +233,156 @@
     close_files_and_terminate();
     do_final_end();
 }
+@ Here is the function that calls the editor, if one is defined. This
+is loosely based on a similar function in kpathsea, but the calling
+convention is quite different.
 
+ at c
+static const_string edit_value = EDITOR;
+
+#if defined(WIN32)
+static int
+Isspace (char c)
+{
+  return (c == ' ' || c == '\t');
+}
+#endif /* WIN32 */
+
+__attribute__ ((noreturn))
+static void luatex_calledit (int baseptr, int linenumber)
+{
+  char *temp, *command, *fullcmd;
+  char c;
+  int sdone, ddone, i;
+  char *filename = makecstring(input_stack[base_ptr].name_field);
+  int fnlength = strlen(filename);
+
+#ifdef WIN32
+  char *fp, *ffp, *env, editorname[256], buffer[256];
+  int cnt = 0;
+  int dontchange = 0;
+#endif
+
+  sdone = ddone = 0;
+
+  /* Close any open input files, since we're going to kill the job.  */
+  close_files_and_terminate();
+
+  /* Replace the default with the value of the appropriate environment
+     variable or config file value, if it's set.  */
+  temp = kpse_var_value (edit_var);
+  if (temp != NULL)
+    edit_value = temp;
+
+  /* Construct the command string.  The `11' is the maximum length an
+     integer might be.  */
+  command = xmalloc (strlen (edit_value) + fnlength + 11);
+
+  /* So we can construct it as we go.  */
+  temp = command;
+
+#ifdef WIN32
+  fp = editorname;
+  if ((isalpha(*edit_value) && *(edit_value + 1) == ':'
+        && IS_DIR_SEP (*(edit_value + 2)))
+      || (*edit_value == '"' && isalpha(*(edit_value + 1))
+        && *(edit_value + 2) == ':'
+        && IS_DIR_SEP (*(edit_value + 3)))
+     )
+    dontchange = 1;
+#endif
+
+  while ((c = *edit_value++) != 0)
+    {
+      if (c == '%')
+        {
+          switch (c = *edit_value++)
+            {
+            case 'd':
+              if (ddone)
+                FATAL1 ("call_edit: `%%d' appears twice in editor command: `%s'", edit_value);
+              sprintf (temp, "%ld", (long int)linenumber);
+              while (*temp != '\0')
+                temp++;
+              ddone = 1;
+              break;
+
+            case 's':
+              if (sdone)
+                FATAL1 ("call_edit: `%%s' appears twice in editor command: `%s'", edit_value);
+              for (i =0; i < fnlength; i++)
+                *temp++ = filename[i];
+              sdone = 1;
+              break;
+
+            case '\0':
+              *temp++ = '%';
+              /* Back up to the null to force termination.  */
+              edit_value--;
+              break;
+
+            default:
+              *temp++ = '%';
+              *temp++ = c;
+              break;
+            }
+        }
+      else {
+#ifdef WIN32
+        if (dontchange)
+          *temp++ = c;
+        else { if(Isspace(c) && cnt == 0) {
+            cnt++;
+            temp = command;
+            *temp++ = c;
+            *fp = '\0';
+          } else if(!Isspace(c) && cnt == 0) {
+            *fp++ = c;
+          } else {
+            *temp++ = c;
+          }
+        }
+#else
+        *temp++ = c;
+#endif
+      }
+    }
+
+  *temp = 0;
+
+#ifdef WIN32
+  if (dontchange == 0) {
+    if(editorname[0] == '.' ||
+       editorname[0] == '/' ||
+       editorname[0] == '\\') {
+      fprintf(stderr, "%s is not allowed to execute.\n", editorname);
+      do_final_end();
+    }
+    env = (char *)getenv("PATH");
+    if(SearchPath(env, editorname, ".exe", 256, buffer, &ffp)==0) {
+      if(SearchPath(env, editorname, ".bat", 256, buffer, &ffp)==0) {
+        fprintf(stderr, "I cannot find %s in the PATH.\n", editorname);
+        do_final_end();
+      }
+    }
+    fullcmd = (char *)xmalloc(strlen(buffer)+strlen(command)+5);
+    strcpy(fullcmd, "\"");
+    strcat(fullcmd, buffer);
+    strcat(fullcmd, "\"");
+    strcat(fullcmd, command);
+  } else
+#endif
+  fullcmd = command;
+
+  /* Execute the command.  */
+  if (system (fullcmd) != 0)
+    fprintf (stderr, "! Trouble executing `%s'.\n", command);
+
+  /* Quit, since we found an error.  */
+  do_final_end ();
+}
+
+
 @ @c
 void error(void)
 {                               /* completes the job of error reporting */
@@ -325,12 +475,23 @@
 #endif
             case 'E':
                 if (base_ptr > 0) {
-                    tprint_nl("You want to edit file ");
-                    print(input_stack[base_ptr].name_field);
-                    tprint(" at line ");
-                    print_int(line);
-                    interaction = scroll_mode;
-                    jump_out();
+                    int callback_id = callback_defined(call_edit_callback);
+                    if (callback_id>0) {
+                        (void)run_callback(callback_id, "Sd->", makecstring(input_stack[base_ptr].name_field), line);
+                        jump_out(); /* should not be reached */
+                    } else {
+                        tprint_nl("You want to edit file ");
+                        print(input_stack[base_ptr].name_field);
+                        tprint(" at line ");
+                        print_int(line);
+                        interaction = scroll_mode;
+                        if (kpse_init) {
+                            luatex_calledit(base_ptr, line);
+                        } else {
+                            tprint_nl("There is no valid callback defined.");
+                            jump_out(); /* should not be reached */
+                        }
+                    }
                 }
                 break;
             case 'H':

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/extensions.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/extensions.w	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/extensions.w	2016-09-23 12:35:11 UTC (rev 42133)
@@ -142,6 +142,8 @@
             set_pdf_literal_mode(tail, direct_always);
         else if (scan_keyword("page"))
             set_pdf_literal_mode(tail, direct_page);
+        else if (scan_keyword("raw"))
+            set_pdf_literal_mode(tail, direct_raw);
         else
             set_pdf_literal_mode(tail, set_origin);
         scan_toks(false, true);

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/mlist.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/mlist.w	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/mlist.w	2016-09-23 12:35:11 UTC (rev 42133)
@@ -271,7 +271,7 @@
 the backward compatibility code, and it means that we can't raise an error here.
 
 @c
-static scaled radical_rule(int var)
+static scaled radical_rule_par(int var)
 {
     scaled a = get_math_param(math_param_radical_rule, var);
     return a;
@@ -978,10 +978,16 @@
   that eventually contains it.
 
 @c
-static pointer do_fraction_rule(scaled t, pointer att)
+static pointer do_fraction_rule(scaled t, pointer att, halfword some_rule, halfword cur_size, halfword cur_fam)
 {
     pointer p;                  /* the new node */
-    p = new_rule(normal_rule);
+    if (math_rules_mode_par) {
+        p = new_rule(some_rule);
+        rule_math_size(p) = cur_size;
+        rule_math_font(p) = fam_fnt(cur_fam, cur_size);
+    } else {
+        p = new_rule(normal_rule);
+    }
     rule_dir(p) = math_direction_par;
     height(p) = t;
     depth(p) = 0;
@@ -994,13 +1000,13 @@
   fraction rule of thickness |t| under additional space of height |ht|.
 
 @c
-static pointer overbar(pointer b, scaled k, scaled t, scaled ht, pointer att)
+static pointer overbar(pointer b, scaled k, scaled t, scaled ht, pointer att, halfword index, halfword cur_size, halfword cur_fam)
 {
     pointer p, q;               /* nodes being constructed */
     p = new_kern(k);
     reset_attributes(p, att);
     couple_nodes(p,b);
-    q = do_fraction_rule(t, att);
+    q = do_fraction_rule(t, att, index, cur_size, cur_fam);
     couple_nodes(q,p);
     p = new_kern(ht);
     reset_attributes(p, att);
@@ -1796,17 +1802,17 @@
 couple of simple ones.
 
 @c
-static void make_over(pointer q, int cur_style)
+static void make_over(pointer q, int cur_style, int cur_size, int cur_fam)
 {
     pointer p;
     p = overbar(clean_box(nucleus(q), cramped_style(cur_style), cur_style),
                 overbar_vgap(cur_style), overbar_rule(cur_style),
-                overbar_kern(cur_style), node_attr(nucleus(q)));
+                overbar_kern(cur_style), node_attr(nucleus(q)), math_over_rule, cur_size, cur_fam);
     math_list(nucleus(q)) = p;
     type(nucleus(q)) = sub_box_node;
 }
 
-static void make_under(pointer q, int cur_style)
+static void make_under(pointer q, int cur_style, int cur_size, int cur_fam)
 {
     pointer p, x, y, r;         /* temporary registers for box construction */
     scaled delta;               /* overall height plus depth */
@@ -1814,7 +1820,7 @@
     p = new_kern(underbar_vgap(cur_style));
     reset_attributes(p, node_attr(q));
     couple_nodes(x,p);
-    r = do_fraction_rule(underbar_rule(cur_style), node_attr(q));
+    r = do_fraction_rule(underbar_rule(cur_style), node_attr(q), math_under_rule, cur_size, cur_fam);
     couple_nodes(p,r);
     y = vpackage(x, 0, additional, max_dimen, math_direction_par);
     reset_attributes(y, node_attr(q));
@@ -1878,7 +1884,7 @@
     scaled delta, clr, theta, h; /* dimensions involved in the calculation */
     x = clean_box(nucleus(q), cramped_style(cur_style), cur_style);
     clr = radical_vgap(cur_style);
-    theta = radical_rule(cur_style);
+    theta = radical_rule_par(cur_style);
     if (theta == undefined_math_parameter) {
         /* a real radical */
         theta = fraction_rule(cur_style);
@@ -1912,7 +1918,7 @@
     }
     shift_amount(y) = (height(y) - theta) - (height(x) + clr);
     h = depth(y) + height(y);
-    p = overbar(x, clr, theta, radical_kern(cur_style), node_attr(y));
+    p = overbar(x, clr, theta, radical_kern(cur_style), node_attr(y), math_radical_rule, cur_size, small_fam(left_delimiter(q)));
     couple_nodes(y,p);
     if (degree(q) != null) {
         scaled wr, br, ar;
@@ -2559,7 +2565,7 @@
             p = new_kern((shift_up - depth(x)) - (height(z) - shift_down));
             couple_nodes(p,z);
         } else {
-            y = do_fraction_rule(thickness(q), node_attr(q));
+            y = do_fraction_rule(thickness(q), node_attr(q), math_fraction_rule, cur_size, math_rules_fam_par);
             p = new_kern((math_axis_size(cur_size) - delta) - (height(z) - shift_down));
             reset_attributes(p, node_attr(q));
             couple_nodes(y,p);
@@ -2656,8 +2662,9 @@
                     math_character(nucleus(q)) = c;
                 }
                 delta = char_italic(cur_f, cur_c);
+printf("delta %i\n",delta);
                 x = clean_box(nucleus(q), cur_style, cur_style);
-                if (delta != null) {
+                if (delta != 0) {
                     if (do_new_math(cur_f)) {
                         /* we never added italic correction */
                     } else if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits)) {
@@ -2712,8 +2719,8 @@
                 */
                 switch (mode) {
                     case 0 :
-                        /* as with limits */
-                        make_scripts(q, p, 0, cur_style, half(delta), -half(delta));
+                        /* full bottom correction */
+                        make_scripts(q, p, 0, cur_style, 0, -delta);
                         break;
                     case 1 :
                         /* MathConstants driven */
@@ -2723,22 +2730,21 @@
                     case 2 :
                         /* no correction */
                         make_scripts(q, p, 0, cur_style, 0, 0);
-                        break;
+                        break ;
                     case 3 :
                         /* half bottom correction */
                         make_scripts(q, p, 0, cur_style, 0, -half(delta));
                         break;
                     case 4 :
-                        /* full bottom correction */
-                        make_scripts(q, p, 0, cur_style, 0, -delta);
+                        /* half bottom and top correction */
+                        make_scripts(q, p, 0, cur_style, half(delta), -half(delta));
                         break;
                     default :
-                        /* half bottom and top correction */
                         if (mode > 15) {
                             /* for quickly testing values */
                             make_scripts(q, p, 0, cur_style, 0, -round_xn_over_d(delta, mode, 1000));
                         } else {
-                            make_scripts(q, p, 0, cur_style, half(delta), -half(delta));
+                            make_scripts(q, p, 0, cur_style, 0, 0);
                         }
                         break;
                 }
@@ -3913,10 +3919,10 @@
                 }
                 break;
             case over_noad_type:
-                make_over(q, cur_style);
+                make_over(q, cur_style, cur_size, math_rules_fam_par);
                 break;
             case under_noad_type:
-                make_under(q, cur_style);
+                make_under(q, cur_style, cur_size, math_rules_fam_par);
                 break;
             case vcenter_noad_type:
                 make_vcenter(q);

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/texfileio.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/texfileio.w	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/texfileio.w	2016-09-23 12:35:11 UTC (rev 42133)
@@ -170,12 +170,12 @@
         case find_data_file_callback:
             ftemp = find_in_output_directory(s);
             if (!ftemp)
-                ftemp = kpse_find_file(s, kpse_tex_format, 0);
+                ftemp = kpse_find_file(s, kpse_tex_format, 1);
             break;
         case find_font_file_callback:
-            ftemp = kpse_find_file(s, kpse_ofm_format, 0);
+            ftemp = kpse_find_file(s, kpse_ofm_format, 1);
             if (ftemp == NULL)
-                ftemp = kpse_find_file(s, kpse_tfm_format, 0);
+                ftemp = kpse_find_file(s, kpse_tfm_format, 1);
             break;
         case find_vf_file_callback:
             ftemp = kpse_find_file(s, kpse_ovf_format, 0);

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/texnodes.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/texnodes.h	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/texnodes.h	2016-09-23 12:35:11 UTC (rev 42133)
@@ -261,6 +261,10 @@
     image_rule,
     empty_rule,
     user_rule,
+    math_over_rule,
+    math_under_rule,
+    math_fraction_rule,
+    math_radical_rule,
 } rule_subtypes;
 
 #  define rule_node_size       8
@@ -270,6 +274,9 @@
 #  define synctex_tag_rule(a)  vinfo((a)+7)
 #  define synctex_line_rule(a) vlink((a)+7)
 
+#  define rule_math_size       rule_index
+#  define rule_math_font       rule_transform
+
 #  define mark_node_size   3
 #  define mark_ptr(a)      vlink((a)+2)
 #  define mark_class(a)    vinfo((a)+2)
@@ -716,6 +723,7 @@
     set_origin = 0,
     direct_page,
     direct_always,
+    direct_raw,
     scan_special,
 } ctm_transform_modes;
 

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/texnodes.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/texnodes.w	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/texnodes.w	2016-09-23 12:35:11 UTC (rev 42133)
@@ -268,7 +268,7 @@
     "fontkern", "userkern", "accentkern", "italiccorrection", NULL
 };
 const char *node_subtypes_rule[] = {
-    "normal", "box", "image", "empty", "user", NULL
+    "normal", "box", "image", "empty", "user", "over", "under", "fraction", "radical", NULL
 };
 const char *node_subtypes_glyph[] = {
     "character", "glyph", "ligature", "ghost", "left", "right", NULL

Modified: trunk/Build/source/texk/web2c/luatexdir/tex/textoken.w
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/textoken.w	2016-09-23 07:54:54 UTC (rev 42132)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/textoken.w	2016-09-23 12:35:11 UTC (rev 42133)
@@ -2437,6 +2437,8 @@
             cur_val = direct_always;
         else if (scan_keyword("page"))
             cur_val = direct_page;
+        else if (scan_keyword("raw"))
+            cur_val = direct_raw;
         else
             cur_val = set_origin;
         save_scanner_status = scanner_status;



More information about the tex-live-commits mailing list