de has to “see” \stopluacode. Use buffers:
\unexpanded\def\startWord
{\grabbufferdata[Word][startWord][stopWord]}
\unexpanded\def\stopWord
{\startluacode
print(buffers.prepend("Word","context[["))
print(buffers.append("Word","]]"))
\stopluacode
rd
{\grabbufferdata[Word][startWord][stopWord]}
\unexpanded\def\stopWord
{\startluacode
print(buffers.prepend("Word","context[["))
print(buffers.append("Word","]]"))
\stopluacode
\ctxluabuffer[Word]}
\starttext
\startWord
ab
):
\startbuffer[lualayer]
% …
\startluacode
…
\stopluacode
\stopbuffer
\doifmode{foo}{\ctxluabuffer[lualayer]}
Wolfgang
___
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist