Skip to content

Commit 765603a

Browse files
do not expand mark content in debug messages (#1616)
1 parent fed358c commit 765603a

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

base/ltmarks.dtx

+17-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
%<*driver>
1818
% \fi
1919
\ProvidesFile{ltmarks.dtx}
20-
[2024/12/25 v1.1b LaTeX Kernel (Marks)]
20+
[2025/01/10 v1.1c LaTeX Kernel (Marks)]
2121
% \iffalse
2222
%
2323
\documentclass{l3doc}
@@ -1476,7 +1476,14 @@
14761476
{
14771477
%<*trace>
14781478
\@@_debug:n { \iow_term:x { Marks:~ extract~ last~
1479-
mark~ for~ class~ '##1'~ =~ \g_@@_tmp_tl } }
1479+
% \end{macrocode}
1480+
% The mark content in \cs{g_@@_tmp_tl} may contain aribtrary code
1481+
% that may react badly if it is expanded in a write. So we better
1482+
% avoid that expansion, otherwise debugging might generate spurious
1483+
% errors when turned on.
1484+
% \changes{v1.1c}{2025/01/10}{Do not expand mark content while debugging}
1485+
% \begin{macrocode}
1486+
mark~ for~ class~ '##1'~ =~ \exp_not:o \g_@@_tmp_tl } }
14801487
%</trace>
14811488
\tl_gput_right:Ne \g_@@_last_marks_tl
14821489
{ \mark_insert:nn {##1} { \@@_drop_id:o { \g_@@_tmp_tl } } }
@@ -1488,10 +1495,15 @@
14881495
% faster in case there is none.
14891496
% \begin{macrocode}
14901497
%<*trace>
1491-
\@@_debug:n { \iow_term:x { Marks:~ extract~ first~
1492-
mark~ for~ class~ '##1'~ =~
1493-
\tex_splitfirstmarks:D
1498+
\@@_debug:n { \iow_term:x {
1499+
Marks:~ extract~ first~ mark~ for~ class~ '##1'~ =~
1500+
% \end{macrocode}
1501+
% Again no expansion for the mark content.
1502+
% \begin{macrocode}
1503+
\exp_not:o {
1504+
\tex_splitfirstmarks:D
14941505
\use:c { c_@@_class_##1_mark }
1506+
}
14951507
} }
14961508
%</trace>
14971509
\tl_gput_right:Ne \g_@@_first_marks_tl

0 commit comments

Comments
 (0)