From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/63698 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: \definenamespace (was: The visual counter module) Date: Thu, 18 Nov 2010 20:05:21 -0500 (EST) Message-ID: References: <20101117191032.GD20635@aides> <8B256D52-298A-462A-9BDD-BBC4A5BF3B67@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-314706142-1290128722=:1909" X-Trace: dough.gmane.org 1290128760 30529 80.91.229.12 (19 Nov 2010 01:06:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 19 Nov 2010 01:06:00 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Nov 19 02:05:56 2010 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 1PJFQK-0004hm-IE for gctc-ntg-context-518@m.gmane.org; Fri, 19 Nov 2010 02:05:56 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 96E21CA851; Fri, 19 Nov 2010 02:05:55 +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 M-3ydAASjLRF; Fri, 19 Nov 2010 02:05:43 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B0E3FCA852; Fri, 19 Nov 2010 02:05:43 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C548DCA852 for ; Fri, 19 Nov 2010 02:05:41 +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 5n9B1wI5DgDB for ; Fri, 19 Nov 2010 02:05:30 +0100 (CET) Original-Received: from filter7-ams.mf.surf.net (filter7-ams.mf.surf.net [192.87.102.75]) by balder.ntg.nl (Postfix) with ESMTP id F2180CA851 for ; Fri, 19 Nov 2010 02:05:29 +0100 (CET) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) by filter7-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oAJ15Psm025766 for ; Fri, 19 Nov 2010 02:05:27 +0100 Original-Received: FROM [10.0.2.15] (Unknown [132.206.94.247]) By tombraider.mr.itd.umich.edu ID 4CE5CD54.25DDC.21280 ; Authuser adityam; 18 Nov 2010 20:05:24 EST In-Reply-To: User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.12.86; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0DDwN5piG - 0fa7133ee5e2 - 20101119 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.75 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:63698 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-314706142-1290128722=:1909 Content-Type: TEXT/PLAIN; charset=windows-1252; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 18 Nov 2010, Wolfgang Schuster wrote: > \parameter use the value from \current while \namedpara= meter > has two argument where the first argument is the name of a command or env= ironment > created with \define. \detokenized... is important when you pass va= lues > from tex to lua and the value contains a tex command, e.g. \thinspace whi= ch > is normally expanded in this case. Thanks. >>> The command key has like the setup key the two values yes and list, >>> with =84command=3Dyes=93 you can write >>> >>> \define[two][one] >> >> I did not know that cloning was possible. The \defineenumeration command= s allows for >> >> \defineenumeration[new][old][..=3D..] >> >> This clones a selected options from old to new (using copyparamters) and= then sets the values of the third arguments. > > \copyparameters is only used for code which doesn=92t use the new paramet= er command > with the parent handling but this method isn=92t necessary in mkiv I am not sure how this is supposed to work. Consider this example: \definenamespace [one] [type=3Dmodule, name=3Done, setup=3Dyes, parent=3D] \definenamespace [two] [type=3Dmodule, name=3Dtwo, command=3Dyes, parent=3Done] \setupone[whatever=3Done] \definetwo[test1] \definetwo[test2][something=3Dtwo] \definetwo[test3][test2] \starttext \startlines >>\namedtwoparameter{test1}{whatever}<< >>\namedtwoparameter{test2}{whatever}<< >>\namedtwoparameter{test2}{something}<< >>\namedtwoparameter{test3}{something}<< \stoplines \stoptext This gives >>one<< >><< >>two<< >><< Why is the value of whatever not set for test2? Why is the value of something not set for test3? >> Would it make sense to add support for >> >> \define[two,three][one][..=3D..]? > > You can redefine \define or leave it out from \definenamespace. I meant that why not \define as follows: \def\define% {\dotripleargument\dodefine} \def\dodefinename[#1][#2][#3]% {\doifassignmentelse{#2} {\getparameters[#1][parent=3D, #2]} {\getparameters[#1][parent=3D#2, #3]}} > What=92s also is to write \define[clone][parent=3D\????parent]. > >>> For parent it=92s the best to give as argument always the same value >>> as you defined for the namespace, e.g. for the fancybreak module >>> one should write =84parent=3Dfancybreak=93. >> >> I thought that you have to write "parent=3D\????fancybreak". > > That happens in the backend hidden from the user/author. Ah, I see. Thanks. Aditya --8323328-314706142-1290128722=:1909 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --8323328-314706142-1290128722=:1909--