The documentation states that \shapemode should reset to 0 at the end
of a paragraph if it is positive, but the following shows otherwise

\catcode`\{=1\catcode`\}=2
\directlua{tex.enableprimitives('',tex.extraprimitives ())}
\shapemode=1
\showthe\shapemode
\quitvmode\par
\showthe\shapemode
\end

I think the fix is a one liner.  I attached a patch.

Udi
From 65dd1c1ac2f5fb0bc65be41b945857aab311f692 Mon Sep 17 00:00:00 2001
From: Udi Fogiel <udifog...@gmail.com>
Date: Sat, 18 Jan 2025 15:19:10 +0200
Subject: [PATCH] fix reset of shape_mode

Consider the following example

\catcode`\{=1\catcode`\}=2
\directlua{tex.enableprimitives('',tex.extraprimitives ())}
\shapemode=1
\showthe\shapemode
\quitvmode\par
\showthe\shapemode
\end

shape_mode is of type int, not dimen
---
 source/texk/web2c/luatexdir/tex/maincontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/texk/web2c/luatexdir/tex/maincontrol.c b/source/texk/web2c/luatexdir/tex/maincontrol.c
index 7c00f0030..a66ad5439 100644
--- a/source/texk/web2c/luatexdir/tex/maincontrol.c
+++ b/source/texk/web2c/luatexdir/tex/maincontrol.c
@@ -1704,7 +1704,7 @@ void normal_paragraph(void)
     if (inter_line_penalties_par_ptr != null)
         eq_define(inter_line_penalties_loc, shape_ref_cmd, null);
     if (shape_mode_par > 0)
-        eq_word_define(dimen_base + shape_mode_code, 0);
+        eq_word_define(int_base + shape_mode_code, 0);
 }
 
 /*tex
-- 
2.44.0

_______________________________________________
dev-luatex mailing list -- dev-luatex@ntg.nl
To unsubscribe send an email to dev-luatex-le...@ntg.nl

Reply via email to