From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/20652 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: \stopbuffer in macro Date: Thu, 02 Jun 2005 22:41:42 +0200 Message-ID: <429F6F06.4070406@wxs.nl> References: <429B8F23.40908@wxs.nl> <429F4182.3080208@elvenkind.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1117746512 29025 80.91.229.2 (2 Jun 2005 21:08:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 2 Jun 2005 21:08:32 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Jun 02 23:08:24 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1DdwuD-0008U5-Ds for gctc-ntg-context-518@m.gmane.org; Thu, 02 Jun 2005 23:07:09 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DBE481280A; Thu, 2 Jun 2005 23:10:17 +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 06184-06-3; Thu, 2 Jun 2005 23:10:13 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DEA05127EE; Thu, 2 Jun 2005 23:10:13 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 42B3C127EF for ; Thu, 2 Jun 2005 23:10:12 +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 06369-01-5 for ; Thu, 2 Jun 2005 23:10:10 +0200 (CEST) Original-Received: from mailrun01.solcon.nl (maillb.solcon.nl [212.45.32.200]) by ronja.ntg.nl (Postfix) with ESMTP id DFF8E127EE for ; Thu, 2 Jun 2005 23:10:10 +0200 (CEST) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay01.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id j52KfxVi010012 for ; Thu, 2 Jun 2005 22:41:59 +0200 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id 699E51FBC5; Thu, 2 Jun 2005 22:12:23 +0200 (CEST) Original-Received: from [10.100.1.53] (unknown [10.100.1.53]) by server-1.pragma-net.nl (Postfix) with ESMTP id 661251B268 for ; Thu, 2 Jun 2005 20:12:22 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <429F4182.3080208@elvenkind.com> X-Virus-Scanned: ClamAV version 0.85.1, clamav-milter version 0.85 on mailrelay01 X-Virus-Status: Clean X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 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-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:20652 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:20652 I once made the option \usememorybuffers but i'm not sure if it does the same =3D=3D=3D=3D Taco Hoekwater wrote: > This should help: >=20 > \def\startLST[#1]% > {\def\stopLST{End of #1}% > \dostartbuffer[LST][startLST][stopLST]} >=20 > This is almost the same as: >=20 > \definebuffer[LST] > \def\stopLST{End of LST} >=20 > Except that it is a little bit more low-level and thereby allows > an argument to \startLST. Using a local definition if \stopLST > is another trick, to lift the argument to the end of the buffer. >=20 > A less sophisticated but clearer approach is: >=20 > \def\startLST[#1]% > {\def\LSTArgs{#1}% > \dostartbuffer[LST][startLST][stopLST]} >=20 > \def\stopLST{End of \LSTArgs} >=20 > Full example: >=20 > \def\startLST[#1]% > {\def\stopLST{End of #1}% > \dostartbuffer[LST][startLST][stopLST]} >=20 > \starttext > \startLST[whatever] > bla bla > \stopLST > alb alb > \stoptext >=20 > You'll have to fill in the commands etc. yourself of course. >=20 > Greetings, Taco >=20 > Peter M=FCnster wrote: >=20 >> On Tue, 31 May 2005, Hans Hagen wrote: >> >> >>> \definebuffer[crap] >>> >>> \setupbuffer[crap][before=3D\blank\bgroup here we start,after=3Dand h= ere=20 >>> we end\egroup\blank] >> >> >> >> [...] >> >> Hello Hans and Taco, >> thank you for your hints, but I think, I did not explain my question w= ell >> enough... >> I fact, all I need is to know, how I could write some verbatim text=20 >> between >> 2 commands (\startXXX...\stopXXX) into a file, but with my own macros. >> Here an example in detail: >> >> \newcount\LSTnum >> \newwrite\LSTfile >> \def\LSTfileprefix{\jobname-LST\LSTnum} >> >> \def\startLST[#1]#2\stopLST{% >> \immediate\openout\LSTfile=3D\LSTfileprefix.tmp >> \immediate\write\LSTfile{#2}% Here I seek a solution for verbatim=20 >> text! >> \immediate\closeout\LSTfile >> \immediate\write18{createListing.sh \LSTfileprefix #1}% #1 is for=20 >> \lstset >> \externalfigure[\LSTfileprefix] >> \advance\LSTnum by 1 >> } >> >> and then, the user types only: >> >> \startLST[language=3DC] >> main() >> { >> return 0; >> } >> \stopLST >> >> It's already possible to do this with some further macros (\finishLST=20 >> after >> \stopLST for example), but I prefer only one \start/\stop pair. >> >> Greetings, Peter >> >=20 > _______________________________________________ > ntg-context mailing list > ntg-context@ntg.nl > http://www.ntg.nl/mailman/listinfo/ntg-context >=20 >=20 >=20 --=20 ----------------------------------------------------------------- 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 -----------------------------------------------------------------