Skip to content

Commit

Permalink
do not expand mark content in debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Jan 10, 2025
1 parent fed358c commit ffda662
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions base/ltmarks.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%<*driver>
% \fi
\ProvidesFile{ltmarks.dtx}
[2024/12/25 v1.1b LaTeX Kernel (Marks)]
[2025/01/10 v1.1c LaTeX Kernel (Marks)]
% \iffalse
%
\documentclass{l3doc}
Expand Down Expand Up @@ -1476,7 +1476,14 @@
{
%<*trace>
\@@_debug:n { \iow_term:x { Marks:~ extract~ last~
mark~ for~ class~ '##1'~ =~ \g_@@_tmp_tl } }
% \end{macrocode}
% The mark content in \cs{g_@@_tmp_tl} may contain aribtrary code
% that may react badly if it is expanded in a write. So we better
% avoid that expansion, otherwise debugging might generate spurious
% errors when turned on.
% \changes{v1.1c}{2025/01/10}{Do not expand mark content while debugging}
% \begin{macrocode}
mark~ for~ class~ '##1'~ =~ \exp_not:o \g_@@_tmp_tl } }
%</trace>
\tl_gput_right:Ne \g_@@_last_marks_tl
{ \mark_insert:nn {##1} { \@@_drop_id:o { \g_@@_tmp_tl } } }
Expand All @@ -1488,10 +1495,15 @@
% faster in case there is none.
% \begin{macrocode}
%<*trace>
\@@_debug:n { \iow_term:x { Marks:~ extract~ first~
mark~ for~ class~ '##1'~ =~
\tex_splitfirstmarks:D
\@@_debug:n { \iow_term:x {
Marks:~ extract~ first~ mark~ for~ class~ '##1'~ =~
% \end{macrocode}
% Again no expansion for the mark content.
% \begin{macrocode}
\exp_not:o {
\tex_splitfirstmarks:D
\use:c { c_@@_class_##1_mark }
}
} }
%</trace>
\tl_gput_right:Ne \g_@@_first_marks_tl
Expand Down

0 comments on commit ffda662

Please sign in to comment.