From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/47293 Path: news.gmane.org!not-for-mail From: "Bart C. Wise" Newsgroups: gmane.comp.tex.context Subject: Remove leading spaces Date: Thu, 5 Feb 2009 13:26:12 -0700 Message-ID: <200902051326.12985.bntgcontext@wiseguysweb.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0339804937==" X-Trace: ger.gmane.org 1233865693 11018 80.91.229.12 (5 Feb 2009 20:28:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Feb 2009 20:28:13 +0000 (UTC) To: Context Mailing List Original-X-From: ntg-context-bounces@ntg.nl Thu Feb 05 21:29:28 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 1LVAqk-0000Ly-8s for gctc-ntg-context-518@m.gmane.org; Thu, 05 Feb 2009 21:29:26 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 436A61FBC1; Thu, 5 Feb 2009 21:28:04 +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 29088-04; Thu, 5 Feb 2009 21:27:06 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4BA351FB7F; Thu, 5 Feb 2009 21:27:06 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A38921FB7F for ; Thu, 5 Feb 2009 21:27:04 +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 26476-07 for ; Thu, 5 Feb 2009 21:26:26 +0100 (CET) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by ronja.ntg.nl (Postfix) with ESMTP id E5C371FB6D for ; Thu, 5 Feb 2009 21:26:26 +0100 (CET) Original-Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) by filter1-ams.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n15KQNhN013285 for ; Thu, 5 Feb 2009 21:26:24 +0100 Original-Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtp (Exim 4.62) (envelope-from ) id 1LVAnl-0002RG-CM for ntg-context@ntg.nl; Thu, 05 Feb 2009 13:26:21 -0700 Original-Received: from bwise1.provo.novell.com ([137.65.171.141] helo=bwise1.localnet) by in01.mta.xmission.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1LVAnf-0008FZ-LS for ntg-context@ntg.nl; Thu, 05 Feb 2009 13:26:21 -0700 User-Agent: KMail/1.11.0 (Linux/2.6.27-11-generic; KDE/4.2.0; x86_64; ; ) X-XM-SPF: eid=; ; ; mid=; ; ; hst=in01.mta.xmission.com; ; ; ip=137.65.171.141; ; ; frm=bntgcontext@wiseguysweb.com; ; ; spf=none X-SA-Exim-Connect-IP: 137.65.171.141 X-SA-Exim-Rcpt-To: ntg-context@ntg.nl X-SA-Exim-Mail-From: bntgcontext@wiseguysweb.com X-Spam-DCC: XMission; sa03 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Context Mailing List X-Spam-Relay-Country: X-SA-Exim-Version: 4.2.1 (built Thu, 25 Oct 2007 00:26:12 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=166.70.13.232; country=US; region=UT; city=Salt Lake City; latitude=40.7242; longitude=-111.8787; metrocode=770; areacode=801; http://maps.google.com/maps?q=40.7242,-111.8787&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 175763588 - 702ba9993967 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 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:47293 Archived-At: --===============0339804937== Content-Type: multipart/alternative; boundary="Boundary-00=_kt0iJwIy2tyHk7/" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-00=_kt0iJwIy2tyHk7/ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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. I would like the output of the following two lines to be equal: This is a \MyFunction[1] test. This is a\MyFunction[1] test. However, they are not because the first line has a space before the function call. \def\MyFunction{\dosingleempty\doMyFunction} \def\doMyFunction[#1]{% \processaction[#1]% [1=>\medspace dog ,% 2=>\medspace cat ,% default=>\ldots]% } \starttext Test1: This is a\MyFunction[1] test. Test2: This is a \MyFunction[1] test. Test3: This is a \MyFunction test. Test4: This is a\MyFunction test. \stoptext Is there a way to do this and not cause any side effects? Thanks, Bart --Boundary-00=_kt0iJwIy2tyHk7/ Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit 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.


I would like the output of the following two lines to be equal:
This is a \MyFunction[1] test.
This is a\MyFunction[1] test.


However, they are not because the first line has a space before the function call.


\def\MyFunction{\dosingleempty\doMyFunction}
\def\doMyFunction[#1]{%
\processaction[#1]%
[1=>\medspace dog ,%
2=>\medspace cat ,%
default=>\ldots]%
}


\starttext
Test1: This is a\MyFunction[1] test.


Test2: This is a \MyFunction[1] test.


Test3: This is a \MyFunction test.


Test4: This is a\MyFunction test.
\stoptext


Is there a way to do this and not cause any side effects?


Thanks,
Bart

--Boundary-00=_kt0iJwIy2tyHk7/-- --===============0339804937== 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0339804937==--