Hi, e-TeX primitive \lastnodetype is not working as documented at the start of programs on WEB2C implementation of pdfTeX, XeTeX and e-pTeX/e-upTeX. (Only LuaTeX is ok.) When the current list is empty, \lastnodetype should return -1 instead of 0.
%#!pdftex
\tracingonline1
\showthe\lastnodetype % => 0 ??
\showlists % => empty
\bye
Hironori Kitagawa found the following issue:
etexdir/etex.ch modifies `@<Start a new current page@>` by
@x [45] m.991 l.19353 - e-TeX last_node_type
last_glue:=max_halfword; last_penalty:=0; last_kern:=0;
@y
last_glue:=max_halfword; last_penalty:=0; last_kern:=0;
last_node_type:=-1;
@z
However, tex.ch (WEB2C change file) overrides it so the change has no effect;
@x [16.215] l.4344 - remove mem[] reference from initialize.
prev_graf:=0; shown_mode:=0;
@<Start a new current page@>;
@y
prev_graf:=0; shown_mode:=0;
@/{The following piece of code is a copy of module 991:}
page_contents:=empty; page_tail:=page_head; {|link(page_head):=null;|}@/
last_glue:=max_halfword; last_penalty:=0; last_kern:=0;
page_depth:=0; page_max_depth:=0;
@z
A patch for
* etexdir/tex.ech
* pdftexdir/pdftex.ch
* xetexdir/xetex.ch
is attached.
Best regards,
Hironobu Yamashita
20180323-etex_init_lastnodetype.patch
Description: Binary data
-------------------------------------------------- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex
