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 p4VLnYZI017922 for ; Tue, 31 May 2011 23:49:35 +0200 Received: (qmail 7212 invoked by alias); 31 May 2011 21:49:28 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 31 May 2011 21:49:28 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx039) with SMTP; 31 May 2011 23:49:28 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p4VLl46l023621 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 31 May 2011 23:47:04 +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 p4VJD4FS004458; Tue, 31 May 2011 23:47:03 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1285398 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 31 May 2011 23:47:03 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p4VLl32n014571 for ; Tue, 31 May 2011 23:47:03 +0200 Received: from mail-yi0-f49.google.com (mail-yi0-f49.google.com [209.85.218.49]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id p4VLkqHR015914 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Tue, 31 May 2011 23:47:02 +0200 Received: by yic15 with SMTP id 15so3089679yic.22 for ; Tue, 31 May 2011 14:46:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.170.66 with SMTP id o42mr6088166yhl.109.1306878411637; Tue, 31 May 2011 14:46:51 -0700 (PDT) Received: by 10.147.39.17 with HTTP; Tue, 31 May 2011 14:46:51 -0700 (PDT) References: <4DE12DD9.9000805@morningstar2.co.uk> <4DE21D52.7060409@morningstar2.co.uk> Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Whitelist: Message-ID: Date: Tue, 31 May 2011 17:46:51 -0400 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: xparse, "while" argument type To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <4DE21D52.7060409@morningstar2.co.uk> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p6l3sTEE4Vf3mL3asGTbKLEdHXRFRRVRnD1Ys/kmZ2gyCT6DCPbRMLwo46E2 /ATCDc0YErewFEHJZSGqL/R8ZAgoNnbAHQu0t19GlSHGq4gxXMjAN6JTxDZvObL24P4Lr7Fgvc1h zrzi/egspfCPFeyxjM1YqjKd8QqWjiqSVcu+9Xs9abfaR23mZ86xsQSTCbVqH8lBl1oBHL6V6Y0q /mBV1; 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: 6776 On 5/29/11, Joseph Wright wrote: > On 28/05/2011 18:33, Bruno Le Floch wrote: >> I have to say that I'm not fully keen either. The reason I'm asking >> here is that I don't want to put some code out there which shows how >> to add extra arguments types to xparse: as discussed earlier, this >> would lead to clashes between packages, and is a bad idea. I don't >> really have a use case (and I don't think that the OP's example is a >> real use case). Perhaps for people who like syntax like "\input foo " >> instead of "\input{foo}"? Or to grab the next word (or whatever)... > > The nearest I've got so far in thinking about it is something like the > case where you are reading from an external table. There, however, you'd > normally grab 'up to' some token (tab, space, ',', ...), then split up > the input with dedicated code. I think that, like verbatim input, the > idea looks a bit too specialised for coverage by xparse. Note that verbatim input cannot be done reliably, while this one can. Actually, I can see it used if someone wants the first word of each paragraph bold (but who would?): \DeclareDocumentCommand { \bw } { w { ! \token_if_letter_p:N } w { \token_if_letter_p:N } } { #1 \textbf {#2} } \toks_put_right:Nn \tex_everypar:D { \bw } (where \everypar should have a LaTeX3 interface). This grabs everything before the first letter as #1, then all letters which follow as #2, and puts that second argument in bold. It fails if there is a space or brace between \bw and the following word. There are probably better ways of doing that, though (I don't know). Regards, Bruno