Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id o8HLb0l2001340 for ; Fri, 17 Sep 2010 23:37:01 +0200 Received: (qmail 17655 invoked by alias); 17 Sep 2010 21:36:55 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 17 Sep 2010 21:36:54 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx003) with SMTP; 17 Sep 2010 23:36:54 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id o8HLZ15o012775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Sep 2010 23:35:01 +0200 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id o8HHkfw4013151; Fri, 17 Sep 2010 23:35:00 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 454842 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 17 Sep 2010 23:35:00 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id o8HLZ0mD017817 for ; Fri, 17 Sep 2010 23:35:00 +0200 Received: from fmmailgate04.web.de (fmmailgate04.web.de [217.72.192.242]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id o8HLYtGQ028106 for ; Fri, 17 Sep 2010 23:34:58 +0200 Received: from mwmweb010 ( [172.20.18.19]) by fmmailgate04.web.de (Postfix) with ESMTP id 850F96A1032C for ; Fri, 17 Sep 2010 23:34:50 +0200 (CEST) Received: from [212.23.104.225] by mwmweb010 with HTTP; Fri Sep 17 23:34:50 CEST 2010 Content-Type: text/plain; charset=UTF-8 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-UI-Message-Type: mail References: <0BFA7483-6E3E-45D0-9094-3DEE5D880A1E@gmail.com> X-UI-ATTACHMENT-ID-POSTFIX: e1a23859-3ae3-4484-b85c-1b82c562f46f X-Priority: 3 Importance: normal Sensitivity: Normal X-Provags-ID: V01U2FsdGVkX18BDlE0VvZgCm/yLd6GXZGIumg7/xMOTjU+Geo6YROjaxd+n87INCy2 z8gYjtfV5N4sjbpk9UYw8ZOvzAXlpinWAHnkzbjz09w= Message-ID: <1816801436.1740507.1284759290533.JavaMail.fmail@mwmweb010> Date: Fri, 17 Sep 2010 23:34:50 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Uwe Lueck Subject: Re: Consistently active characters To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <0BFA7483-6E3E-45D0-9094-3DEE5D880A1E@gmail.com> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p6i75npGen84eVAEFK/syJmFuaL1OLtauwJ5R/kaZ9HAe8peGX1DeqJL7BW4 1X28hmBsSaikXt0ebYfUaHmtXkk7HChP+4IT8tI+yodefY66PMpp/kPudTSzX7BVqDxUGU4uAf/y ckanA==V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 6401 Will Robertson , 17.09.2010 07:21:30: > > \def\foo{... > \lccode`#1=`\~ ! Illegal parameter number in definition of \foo. And according to my own experience, it must be \lccode`\~=`#1..., cf. doc.sty \@sverb/\do@noligs and below. > \lowercase{% > \def ~{...} > } > } > > But this requires that ~ is naturally active; Sure? In my proposal below, ~ is only locally active. > and that's not necessarily always a good assumption > (well, in expl3 isn't definitely not). Arno Trautmann [, 17.09.2010 21:53:19 > > \define_active_char:Nn {} > > which makes the active and assigns the given code to it, > internally using the code that Will wrote. \begingroup \catcode`\~=13 \gdef\define_active_char:Nn#1#2{% \catcode`#113% \begingroup \lccode`\~`#1% \lowercase{\endgroup \def ~{#2}}% } \endgroup Not tested exactly this way, sorry, but in a so far private package of mine, I have \providecommand*{\MakeActiveDef}[2]{% \catcode`#1\active \begingroup \lccode`\~`#1% \lowercase{\endgroup \def ~{#2}}% } so (unless another definition of \MakeActiveDef occurs earlier) \MakeActiveDef and \define_active_char:Nn almost have the same meaning (\active vs. 13, in case LaTeX3 won't have \active). The \endgroup trick here is from doc.sty's \do@noligs. Admittedly \MakeActiveDef has a single instance (though vital) at present, but I have an analogous \MakeActiveLet in niceverb.sty (ctan.org/pkg/nicetext) that has several vital instances (active characters) and has been used in at least one large-scale project. Actually, I prefer \MakeActiveLet to \MakeActiveDef, \MakeActiveDef only exists because I was (for some minutes) unable to use \MakeActiveLet in that other package. I favor \MakeActiveLet for the case that the meaning of a single active character might be wanted to change, so you store intended meanings as macros \@if@active@i, \@if@active@ii, ... and then switch \MakeActiveLet\\@if@active@i somewhere, \MakeActiveLet\\@if@active@ii somewhere else ... Cheers, Uwe. Will Robertson , 17.09.2010 07:21:30: > > \def\foo{... > \lccode`#1=`\~ ! Illegal parameter number in definition of \foo. And according to my own experience, it must be \lccode`\~=`#1..., cf. doc.sty \@sverb/\do@noligs and below. > \lowercase{% > \def ~{...} > } > } > > But this requires that ~ is naturally active; Sure? In my proposal below, ~ is only locally active. > and that's not necessarily always a good assumption > (well, in expl3 isn't definitely not). Arno Trautmann [, 17.09.2010 21:53:19 > > \define_active_char:Nn {} > > which makes the active and assigns the given code to it, > internally using the code that Will wrote. \begingroup \catcode`\~=13 \gdef\define_active_char:Nn#1#2{% \catcode`#113% \begingroup \lccode`\~`#1% \lowercase{\endgroup \def ~{#2}}% } \endgroup Not tested exactly this way, sorry, but in a so far private package of mine, I have \providecommand*{\MakeActiveDef}[2]{% \catcode`#1\active \begingroup \lccode`\~`#1% \lowercase{\endgroup \def ~{#2}}% } so (unless another definition of \MakeActiveDef occurs earlier) \MakeActiveDef and \define_active_char:Nn almost have the same meaning (\active vs. 13, in case LaTeX3 won't have \active). The \endgroup trick here is from doc.sty's \do@ligs. Admittedly \MakeActiveDef has a single instance (though vital) at present, but I have an analogous \MakeActiveLet in niceverb.sty (ctan.org/pkg/nicetext) that has several vital instances (active characters). Actually, I prefer \MakeActiveLet to \MakeActiveDef, \MakeActiveDef only exists because I was for some minutes unable to use \MakeActiveLet in that other package. I favor \MakeActiveLet for the case that the meaning of a single active character might be wanted to change, so you store intended meanings as macros \@if@active@i, \@if@active@ii, ... and then switch \MakeActiveLet\@if@active@i somewhere, \MakeActiveLet\@if@active@ii somewhere else ... Cheers, Uwe.