From d49a974fe604da2c962c7b5ce83dfa91f229f47f Mon Sep 17 00:00:00 2001 From: Luigi Scarso Date: Thu, 29 Feb 2024 22:21:37 +0000 Subject: [PATCH] Default output of \tracingmacros as in pdftex; texconfig.trace_extra_newline adds a newline in \tracingmacros as before (H.Hagen). git-svn-id: svn://tug.org/texlive/trunk/Build/source@70262 c570f23f-e606-0410-a88d-b1316a301751 --- texk/web2c/luatexdir/ChangeLog | 4 ++++ texk/web2c/luatexdir/NEWS | 3 +++ texk/web2c/luatexdir/lua/luainit.c | 3 +++ texk/web2c/luatexdir/luatex_svnversion.h | 2 +- texk/web2c/luatexdir/tex/expand.c | 3 ++- texk/web2c/luatexdir/tex/mainbody.c | 5 +++++ texk/web2c/luatexdir/tex/mainbody.h | 5 +++-- texk/web2c/luatexdir/tex/printing.c | 13 +++++++++---- 8 files changed, 30 insertions(+), 8 deletions(-) diff --git a/texk/web2c/luatexdir/ChangeLog b/texk/web2c/luatexdir/ChangeLog index 877654dfd5..5449ab9aa8 100644 --- a/texk/web2c/luatexdir/ChangeLog +++ b/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,7 @@ +2024-02-29 Luigi Scarso + * Default output of \tracingmacros as in pdftex; texconfig.trace_extra_newline adds a newline in \tracingmacros as before (H.Hagen). + + 2024-02-20 Luigi Scarso * in kpse mode, --shell-escape enable the standard lfs.* and os.* functions otherwise protected * fixed lfs.mkdirp return value diff --git a/texk/web2c/luatexdir/NEWS b/texk/web2c/luatexdir/NEWS index 8a542d6868..c250af07b4 100644 --- a/texk/web2c/luatexdir/NEWS +++ b/texk/web2c/luatexdir/NEWS @@ -13,6 +13,9 @@ LuaTeX 1.18.0 2024-02-13 - With --safer, all debug functions except traceback are nil - New commandline switch --[no-]check-dvi-total-pages exit when DVI exceeds 65535 pages (default: check). This breaks backward compatibility. +- texconfig.trace_extra_newline adds a newline in \tracingmacros. Default is false, so the + output match pdftex. Previously an extra newline was added and + with texconfig.trace_extra_newline=true it is again inserted as before. - Some fixes, among others: * setgentounicode has a glyph_unicode_tree not NULL (thanks M. Chernoff) * Character index within the limits in defining a Type 3 font (H.Hagen). Thanks M. Chernoff. diff --git a/texk/web2c/luatexdir/lua/luainit.c b/texk/web2c/luatexdir/lua/luainit.c index 4997a468c4..4d80d7e4ad 100644 --- a/texk/web2c/luatexdir/lua/luainit.c +++ b/texk/web2c/luatexdir/lua/luainit.c @@ -998,6 +998,7 @@ void lua_initialize(int ac, char **av) haltonerrorp = false; haltingonerrorp = false; tracefilenames = 1; + traceextranewline = 0; dump_name = NULL; /*tex In the next option 0 means ``disable Synchronize TeXnology''. The @@ -1166,6 +1167,8 @@ void lua_initialize(int ac, char **av) get_lua_boolean("texconfig", "check_dvi_total_pages", &check_dvi_total_pages); /*tex |prohibit_file_trace| (boolean) */ get_lua_boolean("texconfig", "trace_file_names", &tracefilenames); + /*tex |trace_extra_newline| (boolean) */ + get_lua_boolean("texconfig", "trace_extra_newline", &traceextranewline); /*tex |file_line_error| */ get_lua_boolean("texconfig", "file_line_error", &filelineerrorstylep); /*tex |halt_on_error| */ diff --git a/texk/web2c/luatexdir/luatex_svnversion.h b/texk/web2c/luatexdir/luatex_svnversion.h index 1f082fe226..fe390ab59e 100644 --- a/texk/web2c/luatexdir/luatex_svnversion.h +++ b/texk/web2c/luatexdir/luatex_svnversion.h @@ -1,4 +1,4 @@ #ifndef luatex_svn_revision_h #define luatex_svn_revision_h -#define luatex_svn_revision 7608 +#define luatex_svn_revision 7611 #endif diff --git a/texk/web2c/luatexdir/tex/expand.c b/texk/web2c/luatexdir/tex/expand.c index e85c8f3bdb..0fd8d91b01 100644 --- a/texk/web2c/luatexdir/tex/expand.c +++ b/texk/web2c/luatexdir/tex/expand.c @@ -654,8 +654,9 @@ void macro_call(void) if (tracing_macros_par > 0) { /*tex Show the text of the macro being expanded. */ begin_diagnostic(); + if (traceextranewline==false) + print_ln(); /* also see newlines in print_input_level */ print_input_level(); - // print_ln(); print_cs(warning_index); token_show(ref_count); end_diagnostic(false); diff --git a/texk/web2c/luatexdir/tex/mainbody.c b/texk/web2c/luatexdir/tex/mainbody.c index cf42b68bfb..d063f0f12b 100644 --- a/texk/web2c/luatexdir/tex/mainbody.c +++ b/texk/web2c/luatexdir/tex/mainbody.c @@ -180,6 +180,11 @@ boolean luainit; boolean tracefilenames; +/*tex Extra line in tracingmacros? */ + +boolean traceextranewline; + + /*tex This program has two important variations: (1) There is a long and slow version diff --git a/texk/web2c/luatexdir/tex/mainbody.h b/texk/web2c/luatexdir/tex/mainbody.h index 6aa7a15f64..f4014101af 100644 --- a/texk/web2c/luatexdir/tex/mainbody.h +++ b/texk/web2c/luatexdir/tex/mainbody.h @@ -117,8 +117,9 @@ names in this program because they are used with a special meaning. # define carriage_return '\r' /* ASCII code used at end of line */ /* Global variables */ -extern boolean luainit; /* are we using lua for initializations */ -extern boolean tracefilenames; /* print file open-close info? */ +extern boolean luainit; /* are we using lua for initializations */ +extern boolean tracefilenames; /* print file open-close info? */ +extern boolean traceextranewline; /* extra line in tracingmacros? */ extern boolean ini_version; /* are we \.{INITEX}? */ diff --git a/texk/web2c/luatexdir/tex/printing.c b/texk/web2c/luatexdir/tex/printing.c index d9ab1b4264..8a52700a60 100644 --- a/texk/web2c/luatexdir/tex/printing.c +++ b/texk/web2c/luatexdir/tex/printing.c @@ -1318,6 +1318,7 @@ void end_diagnostic(boolean blank_line) /* Indentation (based on a suggestion by PO on tex-implementors but adapted to out situation and with built-in limits and so. + It's possible to add an extra newline with texconfig.trace_extra_newline = 1 */ void print_input_level(void) @@ -1330,10 +1331,12 @@ void print_input_level(void) tprint_nl(s); free(s); } else { - print_ln(); + if (traceextranewline) + print_ln(); } } else { - print_ln(); + if (traceextranewline) + print_ln(); } } else { int m = level_max; @@ -1346,14 +1349,16 @@ void print_input_level(void) print(']'); l = l % m; } else { - print_ln(); + if (traceextranewline) + print_ln(); } while (l > 0) { print(c); l--; } } else { - print_ln(); + if (traceextranewline) + print_ln(); } } }