Mojca Miklavec wrote: > On 8/21/07, David Wooten wrote: >> Greetings all, >> >> Has anyone had any luck getting the lilypond module to work with mkiv/ >> luatex engine? It fails for me (works fine with mkii/pdftex). I can >> send along some log info if others have found it to work. > > Hans has mentioned several times that buffers are not going to be > written to files with luaTeX any more. This has a weird consequence on > many modules which relied exactly on that trick. > > Short example of what goes wrong: > > \starttext > > \startbuffer[a] > Hello world! > \stopbuffer > \typebuffer[a] > > %\executesystemcommand{dosomethingwith \jobname-a.tmp} > \stoptext > > The problem is that MK II created a file \jobname-a.tmp and lilypond > module processed exactly that file further. In MK IV, that file is not > created any more (you can check that by running the above example with > --lua first and then with pdfTeX again. Only in the second case a file > [whateverthefilename]-a.tmp is created.) > > Lilypond module relied on that "feature" (I would rather call it > dirty-but-very-useful-trick). > > Hans, what's the current general recipe for this kind of [mis]use of buffers?
I'll add savebuffer to core-buf.* % engine=luatex \startluacode if not buffers.save then function buffers.save(name) if not name or name == "" then name = tex.jobname end local b, f = buffers.data[name], string.format("%s-%s.tmp",tex.jobname,name) b = (b and type(b) == "table" and table.join(b)) or b or "" io.savedata(f,b) end end \stopluacode \def\savebuffer{\dosingleempty\dosavebuffer} \def\dosavebuffer[#1]{\ctxlua{buffers.save("#1")}} \starttext \startbuffer[oeps] oeps \stopbuffer \startbuffer oepsoeps \stopbuffer \savebuffer[oeps] \savebuffer \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | 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 / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________