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 p0A1epvT019980 for ; Mon, 10 Jan 2011 02:40:52 +0100 Received: (qmail 3007 invoked by alias); 10 Jan 2011 01:40:45 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 10 Jan 2011 01:40:45 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx002) with SMTP; 10 Jan 2011 02:40:45 +0100 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 p0A1crrM032760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 10 Jan 2011 02:38:53 +0100 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 p09N14kH028747; Mon, 10 Jan 2011 02:38:43 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 769951 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 10 Jan 2011 02:38:43 +0100 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 p0A1chl1006193 for ; Mon, 10 Jan 2011 02:38:43 +0100 Received: from mail-pz0-f49.google.com (mail-pz0-f49.google.com [209.85.210.49]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id p0A1cbZw032657 for ; Mon, 10 Jan 2011 02:38:41 +0100 Received: by pzk30 with SMTP id 30so5301042pzk.22 for ; Sun, 09 Jan 2011 17:38:37 -0800 (PST) Received: by 10.142.144.15 with SMTP id r15mr3904110wfd.231.1294623517335; Sun, 09 Jan 2011 17:38:37 -0800 (PST) Received: from staff-250-70.wireless.adelaide.edu.au ([129.127.250.70]) by mx.google.com with ESMTPS id y42sm6918540wfd.10.2011.01.09.17.38.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 09 Jan 2011 17:38:35 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1081) References: <7255173980814043.WA.blflatexgmail.com@listserv.uni-heidelberg.de> X-Mailer: Apple Mail (2.1081) X-Spam-Whitelist: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id p0A1chl1006194 Message-ID: Date: Mon, 10 Jan 2011 12:08:31 +1030 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Will Robertson Subject: Re: Verbatim and xparse (yet again :) To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p6i75npGen84eVAEFK/syJmiNoEBJhgjYKpglu1TZLLw7xMZnJMXwBFy+Sxe D/AUQGQOurK3ezVJqUBFH0uN5pjmWoMfpyHp50EZ60/Y6hM43eiKLTaE/W0dI7nIn8+pr4SzneyH Jeytg==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: 6554 Hi Bruno, Just a quick reply, sorry. On 09/01/2011, at 8:53 AM, Bruno Le Floch wrote: > \cprotect\section[...\verb|#&!|...]{...\verb|#&!|...} How does >> \cprotect know what to read in? > > I propose the following: \cprotect[argument specification], where the > argument specification is like in xparse. Your example would become > > \cprotect[om]\section[...\verb|#&!|...]{...\verb|#&!|...} > > If the optional argument is missing, \cprotect\foo could proceed like > this: [snip] This seems like a sensible approach. You could also scan ahead for opening braces and assume if they exist they're an argument for the macro. (Not sure if this would be more or less reliable than the other tests you proposed, though.) > - Maybe also add the case of internal commands (\foo:Nn, or whatever), > where the argument specification would be read from the name? Although > I don't expect any use for that: internals should not need > \cprotect. Should they? I doubt it. FWIW, for expl3 functions you can use \cs_get_arg_count_from_signature:N to find out how many arguments they take. (This is used internally for commands like \cs_new:Nn) -- Will