ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] appendaction in "shipouts" "after" fails in the latest version
@ 2024-09-16  3:52 黄复雄
  2024-09-22  0:31 ` [NTG-context] " 黄复雄
  0 siblings, 1 reply; 4+ messages in thread
From: 黄复雄 @ 2024-09-16  3:52 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 7169 bytes --]

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)

[-- Attachment #2: mini-try.lmtx --]
[-- Type: application/octet-stream, Size: 553 bytes --]

\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")

\stopluacode

\starttext

try

\stoptext


[-- Attachment #3: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [NTG-context] Re: appendaction in "shipouts" "after" fails in the latest version
  2024-09-16  3:52 [NTG-context] appendaction in "shipouts" "after" fails in the latest version 黄复雄
@ 2024-09-22  0:31 ` 黄复雄
  2024-09-22  9:49   ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: 黄复雄 @ 2024-09-22  0:31 UTC (permalink / raw)
  To: ntg-context

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 黄复雄 <aahuaang@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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [NTG-context] Re: appendaction in "shipouts" "after" fails in the latest version
  2024-09-22  0:31 ` [NTG-context] " 黄复雄
@ 2024-09-22  9:49   ` Hans Hagen
  2024-09-23  4:29     ` 黄复雄
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2024-09-22  9:49 UTC (permalink / raw)
  To: ntg-context

On 9/22/2024 2:31 AM, 黄复雄 wrote:
> 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.

i'll fix it but be careful with messing at that level

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [NTG-context] Re: appendaction in "shipouts" "after" fails in the latest version
  2024-09-22  9:49   ` Hans Hagen
@ 2024-09-23  4:29     ` 黄复雄
  0 siblings, 0 replies; 4+ messages in thread
From: 黄复雄 @ 2024-09-23  4:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks!

Best regards,
Huang Fusyong

On Sun, Sep 22, 2024 at 5:54 PM Hans Hagen <j.hagen@xs4all.nl> wrote:
>
> On 9/22/2024 2:31 AM, 黄复雄 wrote:
> > 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.
>
> i'll fix it but be careful with messing at that level
>
> Hans
>
> -----------------------------------------------------------------
>                                            Hans Hagen | PRAGMA ADE
>                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>         tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-23  4:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-16  3:52 [NTG-context] appendaction in "shipouts" "after" fails in the latest version 黄复雄
2024-09-22  0:31 ` [NTG-context] " 黄复雄
2024-09-22  9:49   ` Hans Hagen
2024-09-23  4:29     ` 黄复雄

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).