Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id s52NKoj1029885 for ; Tue, 3 Jun 2014 01:20:51 +0200 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx005) with ESMTPS (Nemesis) id 0M1Qld-1WXkIP3UtN-00tUKG for ; Tue, 03 Jun 2014 01:20:45 +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 s52NIBIV030980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 Jun 2014 01:18:11 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s52M133I018232; Tue, 3 Jun 2014 01:18:10 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11059244 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 3 Jun 2014 01:18:10 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s52NIAPg023342 for ; Tue, 3 Jun 2014 01:18:10 +0200 Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s52NHxrF030561 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Tue, 3 Jun 2014 01:18:03 +0200 Received: by mail-pa0-f41.google.com with SMTP id kx10so4724563pab.28 for ; Mon, 02 Jun 2014 16:17:59 -0700 (PDT) X-Received: by 10.66.149.102 with SMTP id tz6mr43946168pab.76.1401751079223; Mon, 02 Jun 2014 16:17:59 -0700 (PDT) Received: from [192.168.0.9] ([101.166.11.86]) by mx.google.com with ESMTPSA id qj3sm22251229pbc.91.2014.06.02.16.17.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Jun 2014 16:17:58 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) References: <538C959C.3060904@morningstar2.co.uk> X-Mailer: Apple Mail (2.1878.2) X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id s52NIAPg023343 Message-ID: Date: Tue, 3 Jun 2014 08:47:57 +0930 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Will Robertson Subject: Re: 'Preseting' keys To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <538C959C.3060904@morningstar2.co.uk> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by relay2.uni-heidelberg.de id s52NIBIV030980 Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:hxn1ZQ5DDwY=:4Vu95K7Su4q0TU0d1fLe05mGRt 8X5W2NUTN1RsNmZgSBFXpM8axHWyVDVOSBLJvQOxYxIYuLipGRK/kOEB6YBKEa2hv7Zsm4C8j DTL+hyb8ln1vLDj2EVFqQKOFFvK+Fk8jQTpD6glIH8BWmC6lGDKe0oWfWHzhPHm0BIdnYiMyb aFRWDwff2emQpCeiPSbF80O4/usIqf3h/8N7OhRoPOv19BjWl+HdmIkIAm5izW4fwvUYV5bc/ 4DXISgE8GuObTTHd5PNELWae3jKmaFMac5X/jE0nUWdVxbIA6dvfKDTHYUOqDSu8mfvjQgBj8 rTivzyEd2B39f9jaYoYWjy6ldE3RGqF9Kn8f7Gt2hYrxoVXQQvNQCxuXZv7Ygh8LWAm0ox14Z 3uZ3hp6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f7MQntbztwMfeo8a7RSG+a 8GG0b6Sxrei+HwTwkKmIos2+KyGrYHe7o9SOuGnNIuZfRdNdyKRWAZvHU+3eGYmxiAQecrsXq AUCP45Bpz9/D5WqtRTWYwf8Fo8OC8Xlkd8ppGor56 X-UI-Loop:V01:zNrQJzNaQe8=:hHYyxnOxLAdCeypupiSpwiwmvzTa6yb8ZZqIO/dwEa8= Status: R X-Status: X-Keywords: X-UID: 7481 Hi Joseph, I think the name and the functionality are sensible. On 3 Jun 2014, at 12:47 am, Joseph Wright wrote: > However, there are cases where you'd like to 'preset' the key every > time. Currently, that would require >=20 > \cs_new_protected:Npn \foo #1#2 % #1 =3D keys > { > \keys_set:nn { mymod } > { > key-a =3D new-value , > #1 > } >=20 > but that is not that efficient and also not that clear. >=20 > An alternative approach is to provide a method to 'preset' keys from > within the key system, something like >=20 > \keys_define:nn { mymod } > { > key-a .tl_set:N =3D \l_mya_tl , > key-a .preset:n =3D value > ... > } >=20 > where the presetting can avoid having to parse the keys each time it's > run (cf. what happens in template). The first case is what I do in fontspec (but there=92s lots I do in fonts= pec that I probably shouldn't). I suspect that I=92d need to play around with some interfaces to figure o= ut how this would change things. Thinking along these lines: > \cs_new_protected:Npn \foo #1#2 % #1 =3D keys > { > \keys_define:nn { mymod } > { > key-a .preset:n =3D new-value , > } > \keys_set:nn { mymod } > { > #1 > } One thing that becomes a bit harder is unsetting the preset; if I then ne= ed to run \keys_set:nn again the preset would either need to be grouped o= r explicitly disabled. (E.g., when setting Letters=3DSmallCaps for the small caps font before mo= ving on to another font shape.) So at least in my use case, and only thinking very briefly about it, I=92= m not sure if this interface would be a advantage for fontspec =97 but th= at=92s not to say that it=92s not a bad idea, nor either that fontspec co= uldn't be re-jigged to be a bit more sensible in such matters. Cheers, Will