ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* LuaMetaTeX insert nodes patch
@ 2022-09-16 23:39 Max Chernoff via ntg-context
  0 siblings, 0 replies; only message in thread
From: Max Chernoff via ntg-context @ 2022-09-16 23:39 UTC (permalink / raw)
  To: ntg-context; +Cc: Max Chernoff

Hi Hans,

I see that you've released the LuaMetaTeX source code, yay! I'm really
impressed with how easy it is to build, and with how quickly it builds.

Can you please apply this patch to the LuaMetaTeX source code:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git source/lua/lmtnodelib.c source/lua/lmtnodelib.c
index ff98a70..1aade86 100644
--- source/lua/lmtnodelib.c
+++ source/lua/lmtnodelib.c
@@ -6557,10 +6557,7 @@ static int nodelib_common_getfield(lua_State *L, int direct, halfword n)
                             break;
                         case insert_node:
                             if (lua_key_eq(s, index)) {
-                                halfword index = lmt_tohalfword(L, 3);
-                                if (tex_valid_insert_id(index)) {
-                                    insert_index(n) = index;
-                                }
+                                lua_pushinteger(L, insert_index(n));
                             } else if (lua_key_eq(s, cost)) {
                                 lua_pushinteger(L, insert_float_cost(n));
                             } else if (lua_key_eq(s, depth)) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This should fix the following minimal example:

   \startluacode
       local insert = node.new "insert"
       insert.index = 4
       print(insert.index)
   \stopluacode
   
Thanks,
-- Max
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-16 23:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16 23:39 LuaMetaTeX insert nodes patch Max Chernoff via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).