From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/36135 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Buffers (gone) in MK IV (was: MK IV & Lilypond) Date: Tue, 21 Aug 2007 13:51:33 +0200 Message-ID: <46CAD1C5.7050409@wxs.nl> References: <6faad9f00708210424s770aeeb4ja42f758bd768d603@mail.gmail.com> 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 1187697174 24752 80.91.229.12 (21 Aug 2007 11:52:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Aug 2007 11:52:54 +0000 (UTC) Cc: Henning Hraban Ramm To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 21 13:52:52 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 1INSI0-0005hU-1v for gctc-ntg-context-518@m.gmane.org; Tue, 21 Aug 2007 13:52:52 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 069E31FF78; Tue, 21 Aug 2007 13:52:39 +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 04755-01-14; Tue, 21 Aug 2007 13:52:27 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9598220021; Tue, 21 Aug 2007 13:52:27 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BCFEA2002C for ; Tue, 21 Aug 2007 13:52:25 +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 04755-01-13 for ; Tue, 21 Aug 2007 13:52:23 +0200 (CEST) Original-Received: from mail.pragma-ade.net (dsl-083-247-100-017.solcon.nl [83.247.100.17]) by ronja.ntg.nl (Postfix) with ESMTP id 339BD20021 for ; Tue, 21 Aug 2007 13:52:23 +0200 (CEST) Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by controller-1 (SurgeMail 3.7b8) with ESMTP id 10844 for multiple; Tue, 21 Aug 2007 13:51:52 +0200 User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) In-Reply-To: <6faad9f00708210424s770aeeb4ja42f758bd768d603@mail.gmail.com> X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 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:36135 Archived-At: 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 ___________________________________________________________________________________