diff --git a/manual/luatex-nodes.tex b/manual/luatex-nodes.tex index 5a48b4c18add9b1e43bc7a48cc9692babfe2d217..d18006df0cee43ab146dba166316519f80a557e2 100644 --- a/manual/luatex-nodes.tex +++ b/manual/luatex-nodes.tex @@ -890,6 +890,10 @@ The difference between \type {data} and \type {string} is that on assignment, th \type {data} field is converted to a token list, cf.\ use as \lpr {latelua}. The \type {string} version is treated as a literal string. +When a function is used, it gets called with as first argument the node that triggers +the call. + + \stopsection \startsection[title={\DVI\ backend whatsits}] diff --git a/manual/luatex.pdf b/manual/luatex.pdf index 9d722397f068e5df2d7c9291076c851756574077..773d8a931169e9cd61ae32b875e6241aa84d065b 100644 Binary files a/manual/luatex.pdf and b/manual/luatex.pdf differ diff --git a/source/texk/web2c/luatexdir/lua/luastuff.c b/source/texk/web2c/luatexdir/lua/luastuff.c index fb05c60dd1f4f8f98e9632f1758f9481803eedea..feb6a88c8bf26e242fa001a6c940e9328a2557ba 100644 --- a/source/texk/web2c/luatexdir/lua/luastuff.c +++ b/source/texk/web2c/luatexdir/lua/luastuff.c @@ -442,7 +442,7 @@ int lua_traceback(lua_State * L) return 1; } -static void luacall(int p, int nameptr, boolean is_string) +static void luacall(int p, int nameptr, boolean is_string, halfword w) { LoadS ls; int i; @@ -466,7 +466,8 @@ static void luacall(int p, int nameptr, boolean is_string) /*tex put it under chunk */ lua_insert(Luas, base); ++late_callback_count; - i = lua_pcall(Luas, 0, 0, base); + lua_nodelib_push_fast(Luas, w); + i = lua_pcall(Luas, 1, 0, base); /*tex remove traceback function */ lua_remove(Luas, base); if (i != 0) { @@ -600,12 +601,12 @@ void late_lua(PDF pdf, halfword p) if (t == normal) { /*tex sets |def_ref| */ expand_macros_in_tokenlist(p); - luacall(def_ref, late_lua_name(p), false); + luacall(def_ref, late_lua_name(p), false, p); flush_list(def_ref); } else if (t == lua_refid_call) { luafunctioncall(late_lua_data(p)); } else if (t == lua_refid_literal) { - luacall(late_lua_data(p), late_lua_name(p), true); + luacall(late_lua_data(p), late_lua_name(p), true, p); } else { /*tex Let's just ignore it, could be some user specific thing. */ } diff --git a/source/texk/web2c/luatexdir/luatex_svnversion.h b/source/texk/web2c/luatexdir/luatex_svnversion.h index c6864a4aeaedb00a3b6b69a8b20d5c33a346eac6..ced5e39e06e077cb07bf5527c7f83d05f8d1ac37 100644 --- a/source/texk/web2c/luatexdir/luatex_svnversion.h +++ b/source/texk/web2c/luatexdir/luatex_svnversion.h @@ -1,4 +1,4 @@ #ifndef luatex_svn_revision_h #define luatex_svn_revision_h -#define luatex_svn_revision 7501 +#define luatex_svn_revision 7503 #endif