From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78105 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: \startluacode and macro names with underscores Date: Tue, 4 Sep 2012 15:48:26 +0200 Message-ID: <52C3A212-0B79-4D75-869B-0B6E9A206965@gmail.com> References: <20120904154025.4852eb9a@homerow> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1346766520 17173 80.91.229.3 (4 Sep 2012 13:48:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Sep 2012 13:48:40 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 04 15:48:40 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T8tUd-0007Bn-QJ for gctc-ntg-context-518@m.gmane.org; Tue, 04 Sep 2012 15:48:39 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D44FF10200; Tue, 4 Sep 2012 15:48:36 +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 ZL+nQbjWPplx; Tue, 4 Sep 2012 15:48:35 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 89D5E101F2; Tue, 4 Sep 2012 15:48:35 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 19AB0101F2 for ; Tue, 4 Sep 2012 15:48:35 +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 n1j9ZdNtefqZ for ; Tue, 4 Sep 2012 15:48:31 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 425E9101EB for ; Tue, 4 Sep 2012 15:48:31 +0200 (CEST) Original-Received: from mail-bk0-f41.google.com (mail-bk0-f41.google.com [209.85.214.41]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q84DmTe6023920 for ; Tue, 4 Sep 2012 15:48:30 +0200 Original-Received: by bkcjc3 with SMTP id jc3so3126231bkc.14 for ; Tue, 04 Sep 2012 06:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=MSfZ+Zt6RV5RhDXPEKDxzGRdJmSRN7mZ4ilhsbiCc1w=; b=wdbh5eNR+7kFvDBkRsVUe4IuCIO8dPRIdyKRcTP1HnwG3ljeZ+IBq4NirUa7pGgN1Z G1nMTzE2TQ210ByQQMrQyxK0iKgX9xU/01sgN52z8+obM2d2WPkyIWlrE9YiOfLDbn2e GG4VXXKOm6N/d5UCAJhFXXgKw2X/93cOKgwDz5T7kfMpgpZHbKMIPA5gYxIcWibmhKZt qO5e0t9Z0t8lr/8ZCDGDAhC+Kg/VMtdysOz0jUcydA1Vf9HiN5r0yRbbn56Wc3jF4MBg Bfud9LgNIVjqjvWNru9QTkAXX2pMXf39u2vufQdZ2YuUt/4uPrbDs2G5Y2XtMWO82rM8 0j0g== Original-Received: by 10.204.156.73 with SMTP id v9mr8079952bkw.116.1346766509511; Tue, 04 Sep 2012 06:48:29 -0700 (PDT) Original-Received: from [10.65.127.19] ([82.113.121.19]) by mx.google.com with ESMTPS id j9sm10465195bkv.0.2012.09.04.06.48.27 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 06:48:28 -0700 (PDT) In-Reply-To: <20120904154025.4852eb9a@homerow> X-Mailer: Apple Mail (2.1486) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.41; 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: 0RHT1MtnN - 5bc148e7924c - 20120904 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:78105 Archived-At: Am 04.09.2012 um 15:40 schrieb Marco Patzer : > Hi, > > the luacode environment chokes on macro names with underscores. > Example: > > \starttext > \unprotect > > \def\number_two{two} > > \startluacode > userdata = userdata or { } > function userdata.number_one() context("one") end > > -- works > userdata.number_one() > > -- fails > -- context.number_two() > > -- workaround > tex.print("\\number_two") > \stopluacode > > \protect > \stoptext > > Why is that and what can be done to access underscored macros in the > usual way? I guess it's some catcode change from the function that > prints into the TeX stream. Use this in your Lua code: context.unprotect() context.number_two() context.protect() 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________