diff --git a/manual/luatex-tex.tex b/manual/luatex-tex.tex index 250c2cbe6a501f6dcb233de7e3039fae7ffbaf49..2dd9521c4dd6c9f0cd9f9ba7dd3c5326475b368e 100644 --- a/manual/luatex-tex.tex +++ b/manual/luatex-tex.tex @@ -1401,19 +1401,24 @@ mind that the library used in editors assumes a certain logic and is geared for plain and \LATEX, so after a decade users expect a certain behaviour. \starttabulate[|l|p|] -\NC \type{set_synctex_mode} \NC \type {0} is the default and used normal synctex - logic, \type {1} uses the values set by the next - helpers while \type {2} also sets these for glyph - nodes; \type{3} sets glyphs and glue and \type {4} - sets only glyphs \NC \NR -\NC \type{set_synctex_tag} \NC set the current tag (file) value (obeys save stack) \NC \NR -\NC \type{set_synctex_line} \NC set the current line value (obeys save stack) \NC \NR -\NC \type{force_synctex_tag} \NC overload the tag (file) value (\type {0} resets) \NC \NR -\NC \type{force_synctex_line} \NC overload the line value (\type {0} resets) \NC \NR -\NC \type{get_synctex_tag} \NC get the currently set value of tag (file) \NC \NR -\NC \type{get_synctex_line} \NC get the currently set value of line \NC \NR +\NC \type{set_synctex_mode} \NC \type {0} is the default and used normal synctex + logic, \type {1} uses the values set by the next + helpers while \type {2} also sets these for glyph + nodes; \type{3} sets glyphs and glue and \type {4} + sets only glyphs \NC \NR +\NC \type{set_synctex_tag} \NC set the current tag (file) value (obeys save stack) \NC \NR +\NC \type{set_synctex_line} \NC set the current line value (obeys save stack) \NC \NR +\NC \type{force_synctex_tag} \NC overload the tag (file) value (\type {0} resets) \NC \NR +\NC \type{force_synctex_line} \NC overload the line value (\type {0} resets) \NC \NR +\NC \type{get_synctex_tag} \NC get the currently set value of tag (file) \NC \NR +\NC \type{get_synctex_line} \NC get the currently set value of line \NC \NR +\NC \type{set_synctex_no_files} \NC disable synctex file logging \NC \NR \stoptabulate +The last one is somewhat special. Due to the way files are registered in \SYNCTEX\ we need +to explicitly disable that feature if we provide our own alternative if we want to avoid +that overhead. Passing a value of 1 disables registering. + This mechanism is somewhat experimental. \section[texconfig]{The \type {texconfig} table} diff --git a/manual/luatex.pdf b/manual/luatex.pdf index 252452c6751233718cbb1f5f4b9c1588bfe2d45b..07746d3939ef5935da2c2389ccc668407e86521e 100644 Binary files a/manual/luatex.pdf and b/manual/luatex.pdf differ diff --git a/source/texk/web2c/luatexdir/lua/ltexlib.c b/source/texk/web2c/luatexdir/lua/ltexlib.c index 66227a9667b4588ef3f22250e4e5d012b98c3807..65e55705e44c2677418237102a71147bc812c4dc 100644 --- a/source/texk/web2c/luatexdir/lua/ltexlib.c +++ b/source/texk/web2c/luatexdir/lua/ltexlib.c @@ -2352,7 +2352,7 @@ static const struct luaL_Reg nest_m[] = { static void init_nest_lib(lua_State * L) { luaL_newmetatable(L, NEST_METATABLE); - luaL_register(L, NULL, nest_m); + luaL_openlib(L, NULL, nest_m, 0); lua_pop(L, 1); } @@ -3289,6 +3289,13 @@ static int lua_get_synctex_line(lua_State * L) return 1; } +static int lua_set_synctex_no_files(lua_State * L) +{ + halfword flag = lua_tointeger(L, 1); + synctex_set_no_files(flag); + return 0; +} + /* till here */ void init_tex_table(lua_State * L) @@ -3395,6 +3402,7 @@ static const struct luaL_Reg texlib[] = { { "get_synctex_mode", lua_get_synctex_mode }, { "set_synctex_tag", lua_set_synctex_tag }, { "get_synctex_tag", lua_get_synctex_tag }, + { "set_synctex_no_files", lua_set_synctex_no_files }, { "force_synctex_tag", lua_force_synctex_tag }, { "force_synctex_line", lua_force_synctex_line }, { "set_synctex_line", lua_set_synctex_line }, @@ -3405,7 +3413,7 @@ static const struct luaL_Reg texlib[] = { int luaopen_tex(lua_State * L) { - luaL_register(L, "tex", texlib); + luaL_openlib(L, "tex", texlib, 0); /* *INDENT-OFF* */ make_table(L, "attribute", "tex.attribute", "getattribute", "setattribute"); make_table(L, "skip", "tex.skip", "getskip", "setskip"); diff --git a/source/texk/web2c/luatexdir/luatex_svnversion.h b/source/texk/web2c/luatexdir/luatex_svnversion.h index c1c1ad85241d4c4b3985bb046ff9e1a950f118f5..c7e1a41e5bbafa8723d2ca7cf2a62493a02b0b49 100644 --- a/source/texk/web2c/luatexdir/luatex_svnversion.h +++ b/source/texk/web2c/luatexdir/luatex_svnversion.h @@ -1 +1 @@ -#define luatex_svn_revision 6473 +#define luatex_svn_revision 6475 diff --git a/source/texk/web2c/luatexdir/tex/texfileio.w b/source/texk/web2c/luatexdir/tex/texfileio.w index c1610d10d904353743b98053ca593235b7e21e37..a10e9ba63d093361593fbdc2d43c677c8b1fc133 100644 --- a/source/texk/web2c/luatexdir/tex/texfileio.w +++ b/source/texk/web2c/luatexdir/tex/texfileio.w @@ -150,9 +150,6 @@ char *luatex_find_file(const char *s, int callback_index) case find_enc_file_callback: ftemp = kpse_find_file(s, kpse_enc_format, 0); break; - case find_sfd_file_callback: - ftemp = kpse_find_file(s, kpse_sfd_format, 0); - break; case find_map_file_callback: ftemp = kpse_find_file(s, kpse_fontmap_format, 0); break; @@ -967,14 +964,13 @@ void start_input(void) update_terminal(); istate = new_line; /* Prepare new file {\sl Sync\TeX} information */ - if (synctex_par) { + if (! synctex_get_no_files()) { synctexstartinput(); /* Give control to the {\sl Sync\TeX} controller */ } /* Read the first line of the new file */ /* Here we have to remember to tell the |lua_input_ln| routine not to start with a |get|. If the file is empty, it is considered to contain a single blank line. */ - line = 1; if (lua_input_ln(cur_file, 0, false)) { ; diff --git a/source/texk/web2c/luatexdir/tex/texnodes.h b/source/texk/web2c/luatexdir/tex/texnodes.h index bae0d76976c7dcbfced2a6c50b1759cb16016a4c..2bdd432e570d2b8219d2af40fa5c14860e314b81 100644 --- a/source/texk/web2c/luatexdir/tex/texnodes.h +++ b/source/texk/web2c/luatexdir/tex/texnodes.h @@ -1031,6 +1031,8 @@ extern void synctex_set_line(int line); extern void synctex_force_tag(int tag); extern void synctex_force_line(int tag); extern int synctex_get_tag(void); +extern void synctex_set_no_files(int flag); +extern int synctex_get_no_files(void); extern int synctex_get_line(void); #endif diff --git a/source/texk/web2c/luatexdir/tex/texnodes.w b/source/texk/web2c/luatexdir/tex/texnodes.w index 59c0627c563e5338c478127e9f0332299f857a81..d0008b08fc8afd5d0d4f0e65ae9f7265e585e42b 100644 --- a/source/texk/web2c/luatexdir/tex/texnodes.w +++ b/source/texk/web2c/luatexdir/tex/texnodes.w @@ -832,7 +832,8 @@ static int copy_error(halfword p) @ @c static halfword synctex_anyway_mode = 0; /* 2 also glyphs */ -static halfword synctex_line_field = 0; +static halfword synctex_line_field = 0; +static halfword synctex_no_files = 0; void synctex_set_mode(int m) { @@ -844,6 +845,16 @@ int synctex_get_mode(void) return synctex_anyway_mode; }; +void synctex_set_no_files(int f) +{ + synctex_no_files = f; +}; + +int synctex_get_no_files(void) +{ + return (int) synctex_no_files ; +}; + void synctex_set_tag(int t) { cur_input.synctex_tag_field = t; @@ -854,6 +865,7 @@ int synctex_get_tag(void) return (int) cur_input.synctex_tag_field; }; + int synctex_get_line(void) { return (int) synctex_line_field;