Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id s91En4wt005817 for ; Wed, 1 Oct 2014 16:49:05 +0200 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx010) with ESMTPS (Nemesis) id 0Lmvl6-1Y9lQ53nzg-00h7lr for ; Wed, 01 Oct 2014 16:48:58 +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 s91EkhcO007193 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 1 Oct 2014 16:46:43 +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 s91CpfkA029879; Wed, 1 Oct 2014 16:46:43 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11342371 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 1 Oct 2014 16:46:42 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s91Ekgq7010791 for ; Wed, 1 Oct 2014 16:46:42 +0200 Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s91EkPMl006971 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 1 Oct 2014 16:46:28 +0200 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XZLAe-0006eM-6V for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 01 Oct 2014 16:46:24 +0200 Received: from mail-1y.bbox.fr ([194.158.98.14]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XZLAU-0006Zn-MM for public-LATEX-L-0lvw86wZMd8wwC3q1xGJAzLcMfAFj/UcfwJ6n/Uicl4@plane.gmane.org; Wed, 01 Oct 2014 16:46:14 +0200 Received: from drums.chezmoi.fr.i-did-not-set--mail-host-address--so-tickle-me (static-176-182-191-61.ncc.abo.bbox.fr [176.182.191.61]) by mail-1y.bbox.fr (Postfix) with ESMTP id 4BAFD10A for ; Wed, 1 Oct 2014 16:46:14 +0200 (CEST) References: <5429D0DF.7060608@morningstar2.co.uk> <10k836fpz0maa.dlg@nililand.de> X-Url: http://gte.univ-littoral.fr/members/dbitouze/pub/latex X-Archive: encrypt User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id s91Ekgq7010792 Message-ID: Date: Wed, 1 Oct 2014 16:46:13 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: =?utf-8?Q?Denis_Bitouz=C3=A9?= Subject: Re: [l3keys] Suggestion: Add a key property for specifying key that /has/ to be used To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <10k836fpz0maa.dlg@nililand.de> (Ulrike Fischer's message of "Wed, 1 Oct 2014 15:18:57 +0200") Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-MIME-Autoconverted: from 8bit to quoted-printable by relay2.uni-heidelberg.de id s91EkhcO007193 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:XP6UMN8xkro=:iJ5s1QZx1Sv6l/k4I/o0C8EF5R K3C1KBlnCQMbTveKXIOwPv2FUXK2v4CpssAsnmaYp8ZKFkioq2vcQ61/ubhvG3Y3A4vvn9WB2 b7BKI3uNvGtDAs5/ale/PC7MDAkGAEnRj9wE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zCX2PWDxXQyrq3rn33gFiT6iKOLwpAIqWNo+bq+aHGGivUHhh7IJOS80a4dVbe+G cPMUKSajBmCB4+eMpcqj8v1BlglJ6B8J6dkQMgg6l55/pG9vk2pgB2wyE+klNEZODXOSGjHt8 o6i0nI88IMMzp6DG17iWI1pPqGNf+TKzoIBnLH0ZLSyEGcNU2tXgTWb6qDLtkjgcM/w3usHEH QdCjhAieqQWvG8hVJTB6NJ/63YYwzixgtjQR2fbeNBrzSRAlIIrqjY3C2GTAy81KTp2j1+01w cqiBWfeGSn18mLwXKqaGzj8pOHUenScyBqz+gEkodSRTeN37S2 X-UI-Loop:V01:jt9pmEpnou8=:3gJph8UXs3h+xMsrCBTKZuPtSaIpXLKP3sqYDqv1NSs= X-UI-Out-Filterresults: notjunk:1; X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by h1439878.stratoserver.net id s91En4wt005817 Status: R X-Status: X-Keywords: X-UID: 7607 Le 01/10/14 à 15h18, Ulrike Fischer a écrit : > Am Tue, 30 Sep 2014 19:00:52 +0200 schrieb > denis.bitouze-/xtQRdnxTdLaUcvLomQ+0NOM1ZH/LfCJ@public.gmane.org: > >> In the use case I have in mind, `key' would be required and expect an >> integer. Would it be missing, an error message would be emitted; would >> its value be anything but an integer, an(other) error message would be >> emitted. > > It is normally not the *key* that is required but a *value* Except if some keys are considered as mandatory arguments (and they could not be turned into arguments because keys are much more explicit than arguments). > and there is no one-to-one relation between keys and values: e.g. in > geometry you can set the left margins through the keys hmargin, > margin, implicitly when you set other width etc. Indeed. > So a key property .required would be senseful only for "basic keys" > and you would have to be very careful that you use these basic key > if you set the value with other keys too. Indeed but I guess I wouldn't be bitten by this in my real usecase. > Imho it is easier and more logical to test for the value and emit an > error if is doesn't exist. OK but, AFAICS, there isn't any high level key property for this (and that's the point of this thread): `.value_required:' tests for the value only if the corresponding key is used. This is pointed out by the following MWE (that outlines my real usecase as detailed yesterday): the `month' key property has the `.value_required:' property but nothing happens if it isn't used. --8<---------------cut here---------------start------------->8--- \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \int_new:N \l_issue_number_int \int_new:N \l_issue_month_int \int_new:N \l_issue_year_int \keys_define:nn { journal/issuesetup } { number .int_set:N = \l_issue_number_int, month .int_set:N = \l_issue_month_int, year .int_set:N = \l_issue_year_int, number .value_required:, month .value_required:, year .value_required:, } \NewDocumentCommand{\issuesetup}{ m } { \keys_set:nn { journal/issuesetup } { #1 } The~issue's~number~is:~\int_use:N \l_issue_number_int } \ExplSyntaxOff \begin{document} \issuesetup{number=154} \end{document} --8<---------------cut here---------------end--------------->8--- > (Actually I wouldn't emit an error. As almost everyone is using > scrollmode today error message are often ignored. Most of the TeX editors highlight errors, no? At least it is the case for TeXstudio, for instance. > I would give the issue number a default value of > a {\Huge\color{red}XXXXXXX}) I could provide both of them: belt /and/ suspenders! :) -- Denis