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 p7LKkGl1026566 for ; Sun, 21 Aug 2011 22:46:28 +0200 Received: (qmail 3944 invoked by alias); 21 Aug 2011 20:46:11 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 21 Aug 2011 20:46:10 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx021) with SMTP; 21 Aug 2011 22:46:10 +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 p7LKhf9X014966 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 21 Aug 2011 22:43:41 +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 p7LIrZ3E017027; Sun, 21 Aug 2011 22:43:40 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1557356 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sun, 21 Aug 2011 22:43:40 +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 p7LKherp017140 for ; Sun, 21 Aug 2011 22:43:40 +0200 Received: from anchor-post-3.mail.demon.net (anchor-post-3.mail.demon.net [195.173.77.134]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p7LKhVYd014955 for ; Sun, 21 Aug 2011 22:43:34 +0200 Received: from cremornelane.demon.co.uk ([80.177.25.195] helo=palladium.local) by anchor-post-3.mail.demon.net with esmtp (Exim 4.69) id 1QvEri-0006BQ-pX for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sun, 21 Aug 2011 20:43:31 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 References: <4E4FF538.7070601@morningstar2.co.uk> <9788A2B7-3E8F-4D2C-A52E-10999BCB59FA@gmail.com> X-Enigmail-Version: 1.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4E516DF2.4040002@morningstar2.co.uk> Date: Sun, 21 Aug 2011 21:43:30 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: couple of l3keys notes To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <9788A2B7-3E8F-4D2C-A52E-10999BCB59FA@gmail.com> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p5x1RWm4Ldx8s9yiUs4bd0i9TcztkkiEUjaO+JBejqA2pDUj20kpsyQJBFv5 jbZXhhe2Qxe4E77/tjUM+bO2UF0VwKumyS4Z7NOeL1lPnoLJvbvvD338mxuXo0MfVNN37I/aIqcv rElUTdIehM5essMZg7TPtPCR1RV7qiJyfpOGGbGjRMS/MHx3NVXD27e9wQ=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: 6812 On 21/08/2011 08:41, Will Robertson wrote: >>> 3. >>> >>> I think it's generally useful to be able to filter lists of keys into their various modules. >> >> When I was writing l3keys, this idea was not really available in >> pgfkeys. However, there is now a filter add-on to pgfkeys which does >> exactly what you describe. (See the Tikz manual, section 'Key >> Filtering'.) I find some of the current pgfkeys approach a bit hard to >> follow, so if we do want to go this way will probably come up with a >> proposal of my own. I'll come back on this once I've given it some more >> thought, and hopefully will have an interface idea. > > Sure; thanks. I don't think this needs to be too complex; at a bare minimum the xkeyval approach of returning the unset keys works for most cases. Okay, there are several approaches we might consider in this area. There are also questions about what is needed. For example, is it important to _know_ the two independent lists of keys, or just to pass unknown keys from one root to another? I guess I favour the later approach, provided it can do the required work here. With the current implementation, you can achieve something useful with an approach such as \keys_define:nn { foo } { unknown .code:n = { \use:x { \keys_set:nn { bar } { \exp_not:o \l_keys_key_tl \tl_if_blank:nF {#1} { = \exp_not:n {#1} } } } } } which will pass keys not know to 'foo' on to the 'bar' family. The obvious issues with this are (a) it has to be done by hand; (b) it's not particularly efficient; (c) it does not provide an easy way to 'reset' the unknown key; (d) it does not apply _all_ of the 'foo' keys first, so may not behave as expected. (On the last point, I'd actually favour sticking with 'set keys in the order given', as the order is often important even without filtering.) I'm not sure if a separate \keys_filter: function is needed, or what is better is an extension to \keys_define:nn such that \keys_set:nn gains additional abilities. Taking the later approach, we might introduce a ".redirect:n" property: \keys_define:nn { foo } { unknown .redirect:n = { bar } } With this approach, we'd need to decide whether to wait until the end of the 'parent' \keys_set:nn run before doing the redirections, or to do the setting 'now', or indeed whether we need both variants. As I say, at the moment I'd go with 'interleaved' setting. You can also imagine extending such a property to named keys. -- Joseph Wright