First of all, thank you for the new `value` field for `write` whatsit nodes!
So that I have understood it correctly: A debugging package such as nodetree
must not
access the `data` field, as access to the `data` field expands the token list,
which may cause in some circumstances the document to stop compiling?
Access to the new value field is safe as it does not expand?
I have compiled the latest LuaTeX with the lastet commit from Luigi and tried
to test the new `value` field.
\def\hello{\iftrue true\else false\fi}
\def\world{\iftrue true\else false\fi}
\protected\def\HELLO{\iftrue TRUE\else FALSE\fi}
\protected\def\WORLD{\iftrue TRUE\else FALSE\fi}
\noindent \directlua{
local n = node.new("whatsit",1)
n.data = [[(\hello\world)(\HELLO\WORLD)]]
local output = ''
for index, token in pairs(n.value) do
output = output .. string.char(token[2])
end
print(output)
}
test
This is LuaTeX, Version 1.23.2 (TeX Live 2026/dev)
restricted system commands enabled.
(./hans.tex(truetrue)(\HELLO \WORLD )
[1{/usr/local/texlive/2025/texmf-var/fonts/map/pdftex/updmap/pdftex
.map}])</usr/local/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Instead of the output ‘(truetrue)(\HELLO \WORLD )’ I would have expected
‘(\hello\world)(\HELLO\WORLD)’?
I also noticed the following:
I think the field `value` would still have to be entered in the file
`texnodes.c` so that the `node.fields()` function can output it.
```tex
\directlua{
for index, field in pairs(node.fields(node.id('whatsit'), 1)) do
print(field)
end
}
``
diff --git a/source/texk/web2c/luatexdir/tex/texnodes.c
b/source/texk/web2c/luatexdir/tex/texnodes.c
index 47eda07cb..0c8275d10 100644
--- a/source/texk/web2c/luatexdir/tex/texnodes.c
+++ b/source/texk/web2c/luatexdir/tex/texnodes.c
@@ -1049,7 +1049,8 @@ void l_set_whatsit_data(void) {
init_field_key(node_fields_whatsit_write, 0, attr);
init_field_key(node_fields_whatsit_write, 1, stream);
init_field_key(node_fields_whatsit_write, 2, data);
- init_field_nop(node_fields_whatsit_write, 3);
+ init_field_key(node_fields_whatsit_write, 3, value);
+ init_field_nop(node_fields_whatsit_write, 4);
init_node_key(whatsit_node_data, pdf_literal_node, pdf_literal)
init_node_key(whatsit_node_data, pdf_late_literal_node,pdf_late_literal)
Josef
On 30.05.25 16:17, luigi scarso wrote:
>
>
> On Fri, 30 May 2025 at 10:45, Linas Stonys <[email protected]
> <mailto:[email protected]>> wrote:
>
> life is running so fast that change in TL2026 sounds legit.
>
>
> Just pushed in https://gitlab.lisn.upsaclay.fr/texlive/luatex.git
> <https://gitlab.lisn.upsaclay.fr/texlive/luatex.git>
>
> commit ea28673465c4d9445bbb582ccdb5dbea75cafc19 (HEAD -> master,
> origin/master, origin/HEAD)
> Author: Luigi Scarso <[email protected] <mailto:[email protected]>>
> Date: Fri May 30 16:07:24 2025 +0200
>
> Additional 'value' field for write nodes (getfield) for unexpanded token
> tables (H.Hagen). LaTeX 1.23.2
>
>
> --
> luigi
>
> _______________________________________________
> dev-luatex mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
_______________________________________________
dev-luatex mailing list -- [email protected]
To unsubscribe send an email to [email protected]