From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78404 Path: news.gmane.org!not-for-mail From: Philipp Gesang Newsgroups: gmane.comp.tex.context Subject: Re: need help with macro Date: Sun, 23 Sep 2012 16:28:05 +0200 Message-ID: <20120923142805.GB29608@phlegethon.router_intern> References: <20120923133354.GA29608@phlegethon.router_intern> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1055165705==" X-Trace: ger.gmane.org 1348410496 8552 80.91.229.3 (23 Sep 2012 14:28:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Sep 2012 14:28:16 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Sep 23 16:28:21 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 1TFnAS-0000JT-Bu for gctc-ntg-context-518@m.gmane.org; Sun, 23 Sep 2012 16:28:20 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 099F1101F7; Sun, 23 Sep 2012 16:28:15 +0200 (CEST) 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 f4Ch3-IDLLyI; Sun, 23 Sep 2012 16:28:13 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id DD895101EA; Sun, 23 Sep 2012 16:28:12 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 668AF101EA for ; Sun, 23 Sep 2012 16:28:11 +0200 (CEST) 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 t6e6UotOB4er for ; Sun, 23 Sep 2012 16:28:10 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 37941101E8 for ; Sun, 23 Sep 2012 16:28:10 +0200 (CEST) Original-Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q8NES9l0025440 for ; Sun, 23 Sep 2012 16:28:09 +0200 Original-Received: from ix.urz.uni-heidelberg.de (cyrus-portal.urz.uni-heidelberg.de [129.206.100.176]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id q8NES7EA028331 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 23 Sep 2012 16:28:08 +0200 Original-Received: from extmail.urz.uni-heidelberg.de (extmail.urz.uni-heidelberg.de [129.206.100.140]) by ix.urz.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id q8NES7BZ023535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 23 Sep 2012 16:28:07 +0200 Original-Received: from localhost (p5084723F.dip.t-dialin.net [80.132.114.63]) (authenticated bits=0) by extmail.urz.uni-heidelberg.de (8.13.4/8.13.1) with ESMTP id q8NES63m014204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 23 Sep 2012 16:28:06 +0200 Mail-Followup-To: mailing list for ConTeXt users In-Reply-To: X-Operating-System: Linux phlegethon 3.5.3-1-ARCH X-License: "CC-BY-SA 3.0" User-Agent: Mutt/1.5.21 (2010-09-15) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=129.206.210.211; country=DE; region=01; city=Heidelberg; latitude=49.4167; longitude=8.7000; http://maps.google.com/maps?q=49.4167,8.7000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QI2Cs9wp - ccc99cdb8fd9 - 20120923 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:78404 Archived-At: --===============1055165705== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TakKZr9L6Hm6aLOc" Content-Disposition: inline --TakKZr9L6Hm6aLOc Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7 > It=E2=80=99s a expansion problem, you can either expand the content in th= e definition of \mogrify (as seen below) > or you make the \mogrify command unexpanded and you expand the content of= the \wwparameter > (i.e. \doifsomething{=E2=80=A6}{\normalexpanded{\mogrify{=E2=80=A6}}}) Thanks a lot, I rewrote my macros according to your the first suggestion and it works like a breeze. Best regards Philipp >=20 > \unprotect >=20 > \def\mogrify_scan#first#second#third#rest\relax > {\def\m_mogrify_three{#first#second#third}% > \def\m_mogrify_rest {#rest}} >=20 > \def\mogrify#content% > {\begingroup > \edef\m_mogrify_content{#content}% > \expandafter\mogrify_scan\m_mogrify_content\relax > \colored [red]{\m_mogrify_three}% > \colored[green]{\m_mogrify_rest }% > \endgraf > \endgroup} >=20 > \installnamespace {ww} > \installcommandhandler \????ww {ww} \????ww >=20 > \appendtoks > \setuevalue{\currentww}{\wont_work[\currentww]} > \to \everydefineww >=20 > \unexpanded\def\wont_work[#id]% > {\edef\currentww{#id}% > \dosingleempty\wont_work_indeed} >=20 > \def\wont_work_indeed[#setups]#content% > {\iffirstargument\setupcurrentww[#setups]\fi > \doifsomething{\wwparameter{param}}{\mogrify{\wwparameter{param}}}% > \endgraf > \framed{#content}} >=20 > \defineww[wontwork] >=20 > \protect >=20 > \starttext >=20 > \mogrify{foobar}\par%% the macro does work in isolation >=20 > \wontwork[param=3Dwhatever]{will it work?} > \wontwork[param=3D] {this, however, does work} >=20 > \stoptext >=20 > Wolfgang >=20 > _________________________________________________________________________= __________ > If your question is of interest to others as well, please add an entry to= the Wiki! >=20 > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ --=20 () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments --TakKZr9L6Hm6aLOc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEARECAAYFAlBfHHUACgkQ02lYlJYWs9L3AQCfYP4hpaNxknNKrvvL7SXFsfZy wQQAn1CDcPM/4HqcMq7n6G2YGY9qK4pp =c0Il -----END PGP SIGNATURE----- --TakKZr9L6Hm6aLOc-- --===============1055165705== 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 ___________________________________________________________________________________ --===============1055165705==--