From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/46936 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Using defaults and indexes Date: Wed, 21 Jan 2009 16:36:02 +0100 Message-ID: <30C27B4C-BEC1-47D7-82B1-643F689EC3A5@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1232552299 17482 80.91.229.12 (21 Jan 2009 15:38:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Jan 2009 15:38:19 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 21 16:39:31 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 1LPfAv-0006cQ-7w for gctc-ntg-context-518@m.gmane.org; Wed, 21 Jan 2009 16:39:29 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4BBFA1FE1E; Wed, 21 Jan 2009 16:38:09 +0100 (CET) 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 03889-02-3; Wed, 21 Jan 2009 16:37:04 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E6D551FDDB; Wed, 21 Jan 2009 16:37:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 04AD21FDDB for ; Wed, 21 Jan 2009 16:37:03 +0100 (CET) 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 02480-03 for ; Wed, 21 Jan 2009 16:36:25 +0100 (CET) Original-Received: from filter3-nij.mf.surf.net (filter3-nij.mf.surf.net [195.169.124.154]) by ronja.ntg.nl (Postfix) with ESMTP id 8578F1FDDA for ; Wed, 21 Jan 2009 16:36:25 +0100 (CET) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by filter3-nij.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n0LFaMjW029708 for ; Wed, 21 Jan 2009 16:36:24 +0100 Original-Received: by fg-out-1718.google.com with SMTP id 19so1846672fgg.8 for ; Wed, 21 Jan 2009 07:36:22 -0800 (PST) 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=R6W+IgaP+79TDl5/C39sI0y/FMu9n0fVA4xWpywb/eM=; b=se2E6WFuFPVnv6HzFRog3cWzK2yg4BPRfzv4Ux6s2cJkUuARQXWICCw+f+bSSMM0K8 mFg2CuXBE7uPr7aQH1Uwqz5msDRvB7F9NpAeKwTkJ1RXOoBJMOjSRXwFSSdI/gpV0ZFq 6dcmkXbS9y0JE2dzAKT4p00ddLjlSyoxT1+oQ= 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=MWpqvK/HZlRbImbZ9Y2XznX0N5D0riUuftQ2xsu3wz8Q6UrFa1xj3G7v/hdbOCp8K8 Qk7ffc3bC8+YXCjV1SrxKloum6Kzxitqix6jYygU+p2xMg4xIunlwUZ+MANulh1H5IiD 5tU7GFjJAWESXp4CdF5tfE+kzDrEN65fRB6Qg= Original-Received: by 10.86.89.20 with SMTP id m20mr1970510fgb.71.1232552182467; Wed, 21 Jan 2009 07:36:22 -0800 (PST) Original-Received: from ?10.70.222.136? (8.106.113.82.net.de.o2.com [82.113.106.8]) by mx.google.com with ESMTPS id 4sm6199020fge.45.2009.01.21.07.36.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Jan 2009 07:36:21 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.930.3) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=72.14.220.157; 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: 168649596 - 44294c462583 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 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:46936 Archived-At: Am 21.01.2009 um 16:02 schrieb Cecil Westerhof: > And in the main file I have: > > \letterclosing{Hoogachtend}{Cecil Westerhof} > > But I would like to have this as the default, so I could use: > > \letterclosing > > Beside that I would like to have the possibility to use: > > \letterclosing{business} > or > \letterclosing{family} > > This would then use defined values. > > When the first parameter is filled, but not with a recognized value, > then the second parameter should be filled. If not, the compilation of > the file should generate an error. Is this something that can be done? \long\def\letterbody#1% {{\blank[line]\setupindenting[yes,medium]#1\par}} \def\letterclosing {\dodoublegroupempty\doletterclosing} \def\doletterclosing#1#2% {\ifsecondargument \dodoletterclosing{#1}{#2}% \else \doifelsenothing{#1} {\doletterclosing{Hoogachtend,}{Cecil Westerhof}}% {\processaction [#1] [ family=>{\dodoletterclosing{Informal closing,}{Cecil Westerhof}}, business=>{\dodoletterclosing{Formal closing}{Cecil Westerhof}}, unknown=>{\errorisfataltrue\waitonfatalerror}]}% \fi} \def\dodoletterclosing#1#2% {\blank[line]#1\blank[3*line]#2} \setupindenting[yes,none] \starttext \letterbody{\dorecurse{2}{\input knuth\par}} \letterclosing{Hoogachtend,}{Cecil Westerhof} \page \letterbody{\dorecurse{2}{\input knuth\par}} \letterclosing{family} \page \letterbody{\dorecurse{2}{\input knuth\par}} \letterclosing{business} \page \letterbody{\dorecurse{2}{\input knuth\par}} \letterclosing{unknown} \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 ___________________________________________________________________________________