From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/74721 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Problem with \writebetweenlist Date: Sun, 26 Feb 2012 17:28:47 +0100 Message-ID: <4F4A5DBF.5080207@wxs.nl> References: <4F4775A9.8010502@gyza.cz> <4F480809.4090805@wxs.nl> <4F480CED.1010800@gyza.cz> <4F48BFAF.3070909@gyza.cz> <52B0A934-BE34-4465-99BB-67B3E25BC0CD@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; Format="flowed" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1330273751 7530 80.91.229.3 (26 Feb 2012 16:29:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 26 Feb 2012 16:29:11 +0000 (UTC) Cc: mailing list for ConTeXt users To: Wolfgang Schuster Original-X-From: ntg-context-bounces@ntg.nl Sun Feb 26 17:29:11 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 1S1gyD-0007UO-8d for gctc-ntg-context-518@m.gmane.org; Sun, 26 Feb 2012 17:29:09 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6B9E0CB25E; Sun, 26 Feb 2012 17:29:08 +0100 (CET) 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 2W-a2VhHQtca; Sun, 26 Feb 2012 17:29:05 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 41235CB257; Sun, 26 Feb 2012 17:29:05 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 39E4ECB257 for ; Sun, 26 Feb 2012 17:29:04 +0100 (CET) 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 qJCzDuajbXH0 for ; Sun, 26 Feb 2012 17:28:53 +0100 (CET) Original-Received: from filter3-nij.mf.surf.net (filter3-nij.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id 373F8CB251 for ; Sun, 26 Feb 2012 17:28:53 +0100 (CET) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter3-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q1QGSqUK009552 for ; Sun, 26 Feb 2012 17:28:52 +0100 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.100; Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by pragma-net.nl (SurgeMail 5.3h2) with ESMTP (TLS) id 15128-1713362 for multiple; Sun, 26 Feb 2012 17:28:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: <52B0A934-BE34-4465-99BB-67B3E25BC0CD@googlemail.com> X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=11; city=Den Haag; latitude=52.0833; longitude=4.3000; http://maps.google.com/maps?q=52.0833,4.3000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0dGCEsQQC - 3907c7badb37 - 20120226 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 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:74721 Archived-At: On 25-2-2012 17:52, Wolfgang Schuster wrote: > > Am 25.02.2012 um 12:02 schrieb Jaroslav Hajtmar: > >> Thanx Wolfgang >> for reply, but it does not work still. > > I was in a hurry and had no time to test it but the following is tested a= nd works. > > \def\strc_lists_write_between[#tag][#settings]#command% we can overload l= ocation > {\begingroup > \edef\currentlist{#tag}% > \doifelse{\namedlistparameter{#tag}\c!state}\v!start > {\strc_lists_inject_yes[#settings,\c!type=3D\s!command][command=3D{= #command}]} > {\endgroup}} > > \def\strc_lists_write_to_yes[#settings]#first#second% > {\strc_lists_inject_yes[\c!location=3D\v!here,#settings,\c!type=3D\s!s= imple][first=3D{#first},second=3D{#second}]} > > @Hans The =93\s!=94 prefix for first, second and command can=92t be used = because otherwise the keys end up as =93\\s!first =94 in Lua table index. ok, but another one needed fixing as well, so now we have \unexpanded\def\writebetweenlist{\dodoubleempty \strc_lists_write_between} \unexpanded\def\writedatatolist {\dotripleargument\strc_lists_write_data_to} \unexpanded\def\writetolist {\dodoubleempty \strc_lists_write_to} \def\strc_lists_write_between[#tag]% {\begingroup \edef\currentlist{#tag}% \doifelse{\namedlistparameter{#tag}\c!state}\v!start \strc_lists_write_between_yes \strc_lists_write_between_nop} \def\strc_lists_write_between_yes[#settings]#command% = {\strc_lists_inject_yes[#settings,\c!type=3D\s!command][command=3D{#command= }]} \def\strc_lists_write_between_nop[#settings]#command% {\endgroup} \def\strc_lists_write_data_to[#tag]% {\begingroup \edef\currentlist{#tag}% \doifelse{\namedlistparameter{#tag}\c!state}\v!start \strc_lists_write_data_to_yes \strc_lists_write_data_to_nop} \def\strc_lists_write_data_to_yes[#settings][#userdata]% {\ifthirdargument % no need to have an extra step ... used seldom \strc_lists_inject_yes[#settings,\c!type=3D\s!userdata][#userdata]% \else \strc_lists_inject_yes[\c!type=3D\s!userdata][#settings]% \fi} \def\strc_lists_write_data_to_nop[#settings][#userdata]% {\endgroup} \def\strc_lists_write_to[#tag]% {\begingroup \edef\currentlist{#tag}% \doifelse{\namedlistparameter{#tag}\c!state}\v!start \strc_lists_write_to_yes \strc_lists_write_to_nop} \def\strc_lists_write_to_yes[#settings]#first#second% no \s!first = because we don't expand user settings = {\strc_lists_inject_yes[\c!location=3D\v!here,#settings,\c!type=3D\s!simple= ][first=3D{#first},second=3D{#second}]} \def\strc_lists_write_to_nop[#settings]#first#second% {\endgroup} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________