Sorry for re-asking this question by replying to myself; after many trials, I am sure this is a real problem. Any hints are much appreciated.
Regards, 黄复雄(Huang Fusyong) On Mon, Sep 16, 2024 at 11:52 AM 黄复雄 <aahua...@gmail.com> wrote: > > Hello, dear Hans. > > I have a Lua module that doesn't work in the latest version 2024.08.16 > 16:30. After investigation, > I found that the errors first occurred in the appendaction. It could be > appended > normally in the version 2024.04.01 08:59, but failed in the latest version. > So, > I made a minimum runnable example for the appendaction problem, > mini-try.lmtx, as > > ```ConTeXt > \startluacode > Moduledata = Moduledata or {} > Moduledata.vtypeset = Moduledata.vtypeset or {} > > function Moduledata.vtypeset.rotate_all1(head) > print(">>>>>> HERE IS ROTATE_ALL1") > return head, done > end > > function Moduledata.vtypeset.rotate_all2(head) > print(">>>>>> HERE IS ROTATE_ALL2") > return head, done > end > > nodes.tasks.appendaction("processors", "after", > "Moduledata.vtypeset.rotate_all1") > nodes.tasks.appendaction("shipouts", "after", > "Moduledata.vtypeset.rotate_all2") -- fails here > > \stopluacode > > \starttext > > try > > \stoptext > ``` > > Compiled the mini-try.lmtx and got outputs in terminal: > > ```text > D:\ah21\TEX\vertical-typesetting>cd d:\ah21\TEX\vertical-typesetting & > chcp 65001 & context d:\ah21\TEX\vertical-typesetting\mini-try.lmtx > Active code page: 65001 > > resolvers | formats | executing runner 'run luametatex format': > luametatex --jobname="d:/ah21/TEX/vertical-typesetting/mini-try.lmtx" > --socket --shell-escape > --fmt=D:/venvs/context-win64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt > --lua=D:/venvs/context-win64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui > --c:currentrun=1 > --c:fulljobname="d:/ah21/TEX/vertical-typesetting/mini-try.lmtx" > --c:input="d:/ah21/TEX/vertical-typesetting/mini-try.lmtx" > --c:kindofrun=1 --c:maxnofruns=9 > --c:texmfbinpath="D:/venvs/context-win64/tex/texmf-win64/bin" > system > > system > ConTeXt ver: 2024.08.16 16:30 LMTX fmt: 2024.9.15 > int: english/english > system > > system > 'cont-new.mkxl' loaded > open source > level 1, order 1, name > 'D:/venvs/context-win64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' > system > beware: some patches loaded from cont-new.mkiv > close source > level 1, order 1, name > 'D:/venvs/context-win64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' > system > files > jobname > 'd:/ah21/TEX/vertical-typesetting/mini-try', input > 'd:/ah21/TEX/vertical-typesetting/mini-try.lmtx', result > 'd:/ah21/TEX/vertical-typesetting/mini-try' > fonts > latin modern fonts are not preloaded > languages > language 'en' is active > open source > level 1, order 2, name > 'd:/ah21/TEX/vertical-typesetting/mini-try.lmtx' > fonts > preloading latin modern fonts (second stage) > fonts > 'fallback modern rm 12pt' is loaded > >>>>>> HERE IS ROTATE_ALL1 > >>>>>> HERE IS ROTATE_ALL1 > lua error > lua error on line 1 in file > d:/ah21/TEX/vertical-typesetting/mini-try.lmtx: > > registered function call [254]: > ...n64/tex/texmf-context/tex/context/base/mkiv/util-seq.lua:328: > attempt to call a nil value > stack traceback: > ...n64/tex/texmf-context/tex/context/base/mkiv/util-seq.lua:328: > in upvalue 'compile' > ...n64/tex/texmf-context/tex/context/base/mkxl/node-tsk.lmt:231: > in upvalue 'create' > ...n64/tex/texmf-context/tex/context/base/mkxl/node-tsk.lmt:247: > in upvalue 'actions' > ...n64/tex/texmf-context/tex/context/base/mkxl/node-shp.lmt:38: > in function <...n64/tex/texmf-context/tex/context/base/mkxl/node-shp.lmt:37> > (...tail calls...) > 1 >> \startluacode > 2 Moduledata = Moduledata or {} > 3 Moduledata.vtypeset = Moduledata.vtypeset or {} > 4 > 5 function Moduledata.vtypeset.rotate_all1(head) > 6 print(">>>>>> HERE IS ROTATE_ALL1") > 7 return head, done > 8 end > 9 > 10 function Moduledata.vtypeset.rotate_all2(head) > 11 print(">>>>>> HERE IS ROTATE_ALL2") > mtx-context | fatal error: return code: 1 > > D:\ah21\TEX\vertical-typesetting> > ``` > > and got a mini-try-error.log: > > ```text > return { > ["filename"]="d:/ah21/TEX/vertical-typesetting/mini-try.lmtx", > ["lastcontext"]="", > ["lastluaerror"]="registered function call [254]: > ...n64/tex/texmf-context/tex/context/base/mkiv/util-seq.lua:328: > attempt to call a nil value\nstack traceback:\n > ...n64/tex/texmf-context/tex/context/base/mkiv/util-seq.lua:328: in > upvalue 'compile'\n > ...n64/tex/texmf-context/tex/context/base/mkxl/node-tsk.lmt:231: in > upvalue 'create'\n > ...n64/tex/texmf-context/tex/context/base/mkxl/node-tsk.lmt:247: in > upvalue 'actions'\n > ...n64/tex/texmf-context/tex/context/base/mkxl/node-shp.lmt:38: in > function <...n64/tex/texmf-context/tex/context/base/mkxl/node-shp.lmt:37>\n > (...tail calls...)", > ["lasttexerror"]="", > ["linenumber"]=1, > ["luaerrorline"]="328", > ["offset"]=10, > ["skiplinenumber"]=1, > } > > ``` > > and got a mini-try.log: > > ```text > system > > system > ConTeXt ver: 2024.08.16 16:30 LMTX fmt: 2024.9.15 > int: english/english > system > > system > 'cont-new.mkxl' loaded > open source > level 1, order 1, name > 'D:/venvs/context-win64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' > system > beware: some patches loaded from cont-new.mkiv > close source > level 1, order 1, name > 'D:/venvs/context-win64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' > system > files > jobname > 'd:/ah21/TEX/vertical-typesetting/mini-try', input > 'd:/ah21/TEX/vertical-typesetting/mini-try.lmtx', result > 'd:/ah21/TEX/vertical-typesetting/mini-try' > fonts > latin modern fonts are not preloaded > languages > language 'en' is active > open source > level 1, order 2, name > 'd:/ah21/TEX/vertical-typesetting/mini-try.lmtx' > fonts > preloading latin modern fonts (second stage) > fonts > 'fallback modern rm 12pt' is loaded > lua error > lua error on line 1 in file > d:/ah21/TEX/vertical-typesetting/mini-try.lmtx: > > registered function call [254]: > ...n64/tex/texmf-context/tex/context/base/mkiv/util-seq.lua:328: > attempt to call a nil value > stack traceback: > ...n64/tex/texmf-context/tex/context/base/mkiv/util-seq.lua:328: > in upvalue 'compile' > ...n64/tex/texmf-context/tex/context/base/mkxl/node-tsk.lmt:231: > in upvalue 'create' > ...n64/tex/texmf-context/tex/context/base/mkxl/node-tsk.lmt:247: > in upvalue 'actions' > ...n64/tex/texmf-context/tex/context/base/mkxl/node-shp.lmt:38: in > function <...n64/tex/texmf-context/tex/context/base/mkxl/node-shp.lmt:37> > (...tail calls...) > 1 >> \startluacode > 2 Moduledata = Moduledata or {} > 3 Moduledata.vtypeset = Moduledata.vtypeset or {} > 4 > 5 function Moduledata.vtypeset.rotate_all1(head) > 6 print(">>>>>> HERE IS ROTATE_ALL1") > 7 return head, done > 8 end > 9 > 10 function Moduledata.vtypeset.rotate_all2(head) > 11 print(">>>>>> HERE IS ROTATE_ALL2") > > ``` > > My question is: Can I still appendaction in "shipouts" "after"? If so, > how to do it? > > Best regards, > 黄复雄(Huang Fusyong) ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________