From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/51362 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Example of passing unexpanded text between \startfoo ... \stopfoo into Lua? Date: Thu, 18 Jun 2009 18:53:45 +0200 Message-ID: <68736D61-A4DD-4A68-94CE-E25ACC5F6BAE@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1245344118 26125 80.91.229.12 (18 Jun 2009 16:55:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Jun 2009 16:55:18 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jun 18 18:55:15 2009 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 1MHKtO-0007ff-Us for gctc-ntg-context-518@m.gmane.org; Thu, 18 Jun 2009 18:55:15 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 543E01FBF9; Thu, 18 Jun 2009 18:55:14 +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 30561-02; Thu, 18 Jun 2009 18:54:18 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 10E4C1FB82; Thu, 18 Jun 2009 18:54:18 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6CF8A1FB82 for ; Thu, 18 Jun 2009 18:54:16 +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 30562-03-3 for ; Thu, 18 Jun 2009 18:54:06 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by ronja.ntg.nl (Postfix) with ESMTP id D54D11FB64 for ; Thu, 18 Jun 2009 18:54:06 +0200 (CEST) Original-Received: from mail-fx0-f213.google.com (mail-fx0-f213.google.com [209.85.220.213]) by filter3-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n5IGs6e4002537 for ; Thu, 18 Jun 2009 18:54:06 +0200 Original-Received: by fxm9 with SMTP id 9so1441737fxm.2 for ; Thu, 18 Jun 2009 09:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=NyQueihXwL9vV1G5h6skoVOlO3VF5ySYzrl+BSqe1tw=; b=PLa08Sj9B4d8SRi0kaGXsmVpWRcNNwpdSQF2aRy79TTOugSn1zT+dtnBhuOFgpGFCp A+hJALjj+9IE9JybV5/AaIAC1tvkfiW71YEr5z6ZilnLZiExeFz/4ernn8+D7TrBnv7W wdFGAulrAVnbdkpIen1fxp6cfsFSrAMQ4U7U4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=jo/hbJBwAMDItzDJwqkMuqUu8JrSvGtCguvKGht96qroDshU+bVtuPYA4i7X1ySiS+ jxHP36rOABLzC6Dvev8hZO0+5W+jv6H1TyD5Wcu2GLomXFsXTKD+KCLd0WVNblmXUtWf xjijxQkoK3lLvr8zbRAoTqEyubKakzoS25lC0= Original-Received: by 10.86.33.9 with SMTP id g9mr2206032fgg.66.1245344045675; Thu, 18 Jun 2009 09:54:05 -0700 (PDT) Original-Received: from ?10.40.233.10? ([82.113.121.158]) by mx.google.com with ESMTPS id l19sm16701960fgb.12.2009.06.18.09.53.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 18 Jun 2009 09:54:05 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.935.3) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.220.213; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 245701886 - 59507f56fd83 - 20090618 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 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:51362 Archived-At: Am 18.06.2009 um 18:21 schrieb Kevin D. Robbins: > Hi Hans and others, > > I've been searching the mailing list and source code for one or more > examples of passing unexpanded text appearing between a > \startfoo ... \stopfoo block into Lua, but without luck. Is there > such an example you could point me to? Something like this (if not give us more information)? \def\startcodeblock {\begingroup \setcatcodetable\luacatcodes \dodoubleempty\dostartcodeblock} \long\def\dostartcodeblock[#1][#2]#3\stopcodeblock {\modulecode{literateprogramming.codeblock([==[#3]==])}% \endgroup} \startmodulecode literateprogramming = literateprogramming or { } function literateprogramming.codeblock(content) global.print(content) end \stopmodulecode \starttext \startcodeblock[language=c,file=foo.c, etc.][blockname] // This is the main routine... int main() { return 0; } \stopcodeblock \stoptext Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________