From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/36190 Path: news.gmane.org!not-for-mail From: David Wooten Newsgroups: gmane.comp.tex.context Subject: Re: Buffers (gone) in MK IV (was: MK IV & Lilypond) Date: Sat, 25 Aug 2007 11:49:50 -0700 Message-ID: <978EBAB0-A586-4DBE-829A-825176AE892F@trichotomic.net> References: <6faad9f00708210424s770aeeb4ja42f758bd768d603@mail.gmail.com> <46CAD1C5.7050409@wxs.nl> <6faad9f00708211553ve4d3d76s1a0ace13b6bd8693@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1188069172 15219 80.91.229.12 (25 Aug 2007 19:12:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 25 Aug 2007 19:12:52 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Aug 25 21:12:49 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 1IP13w-0002pH-73 for gctc-ntg-context-518@m.gmane.org; Sat, 25 Aug 2007 21:12:48 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C047E1FA80; Sat, 25 Aug 2007 21:11: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 11067-03-5; Sat, 25 Aug 2007 21:11:48 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 77C89201D6; Sat, 25 Aug 2007 20:50:02 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 87E90201C8 for ; Sat, 25 Aug 2007 20:50:00 +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 09631-06 for ; Sat, 25 Aug 2007 20:49:54 +0200 (CEST) Original-Received: from mail2.sea5.speakeasy.net (mail2.sea5.speakeasy.net [69.17.117.4]) by ronja.ntg.nl (Postfix) with ESMTP id 1C54D1FB1F for ; Sat, 25 Aug 2007 20:49:53 +0200 (CEST) Original-Received: (qmail 23563 invoked from network); 25 Aug 2007 18:49:52 -0000 Original-Received: from camus.phaedo.com (HELO [192.168.2.48]) ([64.81.243.229]) (envelope-sender ) by mail2.sea5.speakeasy.net (qmail-ldap-1.03) with AES128-SHA encrypted SMTP for ; 25 Aug 2007 18:49:52 -0000 In-Reply-To: <6faad9f00708211553ve4d3d76s1a0ace13b6bd8693@mail.gmail.com> X-Mailer: Apple Mail (2.752.3) 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:36190 Archived-At: Greetings, Did we end up with a working solution for t-lilypond? I've tinkered a bit Hans' response, too, but without luck. Dave On Aug. 21, 2007, at Aug 21, 3:53 PM, Mojca Miklavec wrote: > 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 ___________________________________________________________________________________