From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/47294 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Remove leading spaces Date: Thu, 5 Feb 2009 21:36:16 +0100 Message-ID: <0B4DB4E0-89BE-4EAE-A3E1-2371378C177B@gmail.com> References: <200902051326.12985.bntgcontext@wiseguysweb.com> 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 1233866339 13436 80.91.229.12 (5 Feb 2009 20:38:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Feb 2009 20:38:59 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Feb 05 21:40:13 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 1LVB17-0004NS-Pe for gctc-ntg-context-518@m.gmane.org; Thu, 05 Feb 2009 21:40:09 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C5FB31FBC5; Thu, 5 Feb 2009 21:38:48 +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 05124-01; Thu, 5 Feb 2009 21:37:40 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0B9DD1FB8F; Thu, 5 Feb 2009 21:37:40 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7D75F1FB8F for ; Thu, 5 Feb 2009 21:37:38 +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 30039-05-2 for ; Thu, 5 Feb 2009 21:37:02 +0100 (CET) Original-Received: from filter1-nij.mf.surf.net (filter1-nij.mf.surf.net [195.169.124.152]) by ronja.ntg.nl (Postfix) with ESMTP id 4666A1FB7F for ; Thu, 5 Feb 2009 21:37:02 +0100 (CET) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by filter1-nij.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n15Kb1d8003053 for ; Thu, 5 Feb 2009 21:37:01 +0100 Original-Received: by fg-out-1718.google.com with SMTP id e21so287241fga.8 for ; Thu, 05 Feb 2009 12:37:01 -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=uK1sQAZRklI6O1vD0cwTxHrJUNLIuoDyw9f1++BIgF4=; b=R5vuD4KFkPvgwNAlP6F5MMoeh4vcZDOARZ7zX1MwlwaTukXl5VT1RhiY6wyXanj6n5 EwGg927WFLqhkS6r6/WAzPkzeNHlwzCPwmU90HXkXg9mWMdOvq1zxfSCHJcoW9+PTQ8Y VnSmq075ZNAvU725I06z0IWvcYyLgHc3gmN3A= 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=GRWHHSqyhA0F8uFkmHDDHtB0U2mPwsligPDrQBSujau6CrgFAeAAHrpJtGD2EOVF4t P84W4U9NnXWYqgSLA7Huxy1zsp6uwENAZiEY4rvlelZDW1mJu4hY1D+SBcnX8eMCDmGi e0mj6N61Bg7Gu3RWD9ZHgXKiIBcV4/psN0C6M= Original-Received: by 10.86.31.18 with SMTP id e18mr551469fge.72.1233866220979; Thu, 05 Feb 2009 12:37:00 -0800 (PST) Original-Received: from ?10.40.91.250? (8.121.113.82.net.de.o2.com [82.113.121.8]) by mx.google.com with ESMTPS id e11sm973197fga.30.2009.02.05.12.36.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 05 Feb 2009 12:37:00 -0800 (PST) In-Reply-To: <200902051326.12985.bntgcontext@wiseguysweb.com> X-Mailer: Apple Mail (2.930.3) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=72.14.220.156; 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: 175767312 - 0c95fb4796cf X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.152 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:47294 Archived-At: Am 05.02.2009 um 21:26 schrieb Bart C. Wise: > When a function is called, I would like to remove any leading space. > Then the function can control the spacing. If I don't remove spaces, > it then makes a difference whether or not I have a space before the > function is called. > > Is there a way to do this and not cause any side effects? You can use \removeunwantedpsaces to remove preceding spaces before your command and \ignorespaces to gobble spaces after your command. A faster version of your macro is: \def\MyFunction {\dosingleempty\doMyFunction} \def\doMyFunction[#1]% {\removeunwantedspaces\executeifdefined{myfunction:#1} {\getvalue{myfunction:default}}} \setvalue{myfunction:1}{\medspace dog } \setvalue{myfunction:2}{\medspace cat } \setvalue{myfunction:default}{\ldots} 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 ___________________________________________________________________________________