From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/70069 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: =?utf-8?b?RmluZGluZyB2YWx1ZXMg4oCL4oCLb2YgdGhlIGNv?= =?utf-8?q?ntext_macros_inside_Lua_functions_=28=3Dexpansion_inside_Lua_fu?= =?utf-8?b?bmN0aW9ucz8p?= Date: Sun, 17 Jul 2011 15:40:08 +0200 Message-ID: References: <4E22CF21.9060603@gyza.cz> <37B73A08-F808-4120-AF73-D313BD575015@googlemail.com> <4E22D89C.6060609@gyza.cz> <579F54E4-80CD-4356-8294-3A5FBA13ABAC@googlemail.com> <4E22DF4D.7070109@gyza.cz> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1310910040 22895 80.91.229.12 (17 Jul 2011 13:40:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 17 Jul 2011 13:40:40 +0000 (UTC) Cc: mailing list for ConTeXt users To: hajtmar@gyza.cz Original-X-From: ntg-context-bounces@ntg.nl Sun Jul 17 15:40:35 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QiRaD-0005RF-WB for gctc-ntg-context-518@m.gmane.org; Sun, 17 Jul 2011 15:40:34 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F35F2CAE62; Sun, 17 Jul 2011 15:40:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7iOJsp45TnKa; Sun, 17 Jul 2011 15:40:29 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B925FCAE5E; Sun, 17 Jul 2011 15:40:29 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EBAE5CAE5E for ; Sun, 17 Jul 2011 15:40:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id D2e1k9WoOYDD for ; Sun, 17 Jul 2011 15:40:18 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 2417FCAE56 for ; Sun, 17 Jul 2011 15:40:18 +0200 (CEST) Original-Received: from mail-fx0-f42.google.com (mail-fx0-f42.google.com [209.85.161.42]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p6HDeBWr007402 for ; Sun, 17 Jul 2011 15:40:13 +0200 Original-Received: by fxe23 with SMTP id 23so4698265fxe.15 for ; Sun, 17 Jul 2011 06:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=jQxbnZfplfLmNWNIaAT4z26tQjNkW9CO82YUiAwe4/o=; b=NJf0iEXq0PC3tZg6sf+R7Sw7SMBnDQqFjRLgK0+qbCzNR9GrCuREQgMd0TOg4T3u5I ZBlUEnxAM7FVTPIlohjjfkIuipdT6gxAEVbAc2vrSsXo6gF1j9mIwoexnrD14J1Y96/8 8Y8fttLhUfkNPHjRfUcWK2MWQVB5VaDCCzl3U= Original-Received: by 10.223.24.17 with SMTP id t17mr8313380fab.143.1310910011308; Sun, 17 Jul 2011 06:40:11 -0700 (PDT) Original-Received: from [192.168.2.31] (p5482DC2B.dip.t-dialin.net [84.130.220.43]) by mx.google.com with ESMTPS id h9sm2217158faa.39.2011.07.17.06.40.09 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Jul 2011 06:40:10 -0700 (PDT) In-Reply-To: <4E22DF4D.7070109@gyza.cz> X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.42; 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: 0rF91Eb7a - 8efeae9339ab - 20110717 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:70069 Archived-At: Am 17.07.2011 um 15:10 schrieb Jaroslav Hajtmar: > then it's not for me very good news, because I thus probably not my modul= e to process only at the Lua language ... You can=92t expand macro from Lua but the following is possible: \startluacode values =3D { I =3D "1", II =3D "2", } function test(arg) if string.find(arg,"\\macro") then arg =3D string.gsub(arg,"\\macro","") if values[arg] then context(values[arg]) else context("Invalid index.") end else context("Invalid command.") end end \stopluacode \starttext \starttabulate \NC \type{\macroI} \EQ \ctxlua{test("\\macroI")} \NC\NR \NC \type{\macroII} \EQ \ctxlua{test("\\macroII")} \NC\NR \NC \type{\macroIII} \EQ \ctxlua{test("\\macroIII")} \NC\NR \NC \type{\foo} \EQ \ctxlua{test("\\foo")} \NC\NR \stoptabulate \stoptext Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________