From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/36141 Path: news.gmane.org!not-for-mail From: "Mojca Miklavec" Newsgroups: gmane.comp.tex.context Subject: Re: Buffers (gone) in MK IV (was: MK IV & Lilypond) Date: Wed, 22 Aug 2007 00:53:32 +0200 Message-ID: <6faad9f00708211553ve4d3d76s1a0ace13b6bd8693@mail.gmail.com> References: <6faad9f00708210424s770aeeb4ja42f758bd768d603@mail.gmail.com> <46CAD1C5.7050409@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1187736855 3951 80.91.229.12 (21 Aug 2007 22:54:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Aug 2007 22:54:15 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 22 00:54:13 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1INcbz-0006Lh-E2 for gctc-ntg-context-518@m.gmane.org; Wed, 22 Aug 2007 00:54:11 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 85D34202F3; Wed, 22 Aug 2007 00:54:10 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 00959-07; Wed, 22 Aug 2007 00:53:54 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 572BA202B0; Wed, 22 Aug 2007 00:53:54 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 09758202B0 for ; Wed, 22 Aug 2007 00:53:49 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01527-01 for ; Wed, 22 Aug 2007 00:53:37 +0200 (CEST) Original-Received: from hu-out-0506.google.com (hu-out-0506.google.com [72.14.214.235]) by ronja.ntg.nl (Postfix) with ESMTP id 61D8320298 for ; Wed, 22 Aug 2007 00:53:36 +0200 (CEST) Original-Received: by hu-out-0506.google.com with SMTP id 32so2616245huf for ; Tue, 21 Aug 2007 15:53:35 -0700 (PDT) Original-Received: by 10.142.52.9 with SMTP id z9mr1132292wfz.1187736813045; Tue, 21 Aug 2007 15:53:33 -0700 (PDT) Original-Received: by 10.143.7.3 with HTTP; Tue, 21 Aug 2007 15:53:32 -0700 (PDT) In-Reply-To: <46CAD1C5.7050409@wxs.nl> Content-Disposition: inline X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:36141 Archived-At: On 8/21/07, Hans Hagen wrote: > 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.* Thanks a lot for that one! > % 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 I now tried to add the following three lines to t-lilypond.tex: \def\PDF{texmfstart --ifchanged=\lily!filename.eps pstopdf \lily!filename.eps} \beginLUATEX \savebuffer[lilypond-\the\lily!figures]% \endLUATEX \ifeof18 \installprogram{\LP}% etc. But luaTeX now reports the following to console: system (LUATEX) : [line 32] \savebuffer [lilypond-\the \lily!figures ]\endLUATEX \ifeof 18 \installprogram {\LP }\doif \jobsuffix {pdf}{\installprogram {\PDF }}\else \executesystemcommand {\LP }\doif \jobsuffix {pdf}{\executesystemcommand {\PDF }}\fi \doifelse \jobsuffix {pdf} {\edef \lily!img {\lily!filename .pdf}}{\edef \lily!img {\lily!filename .eps}}\ifvmode \getfiguredimensions [\lily!filename .pdf]\leavevmode \newdimen \FigWidth \FigWidth =\figurewidth \ifdim \FigWidth >\localhsize \!!dimena =\localhsize \advance \!!dimena by-\FigWidth \noindent \hskip \!!dimena \fi \fi \externalfigure [\lily!img ]\egroup and then systems : end file li at line 34 ) (\end occurred inside a group at level 1) ### simple group (level 1) entered at line 32 ({) ### bottom level ... No pages of output. Transcript written on li.log. It seems like a problem with grouping, but I have no idea how to prevent luaTeX from parsing the input further from what it's supposed to read. Mojca ___________________________________________________________________________________ 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 ___________________________________________________________________________________