From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/114923 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerben Wierda via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Does \startnotallmodes work? Date: Wed, 11 May 2022 10:33:38 +0200 Message-ID: <5ED43A32-3C9B-4BF7-B015-7BAFBE66D182@rna.nl> References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\)) Content-Type: multipart/mixed; boundary="===============8146753520697124565==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26522"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gerben Wierda , Rik Kabel To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed May 11 10:35:15 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nohoR-0006aD-6n for gctc-ntg-context-518@m.gmane-mx.org; Wed, 11 May 2022 10:35:15 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 82783289C1C; Wed, 11 May 2022 10:33:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8Xh6VducdRt0; Wed, 11 May 2022 10:33:45 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6765B289DF8; Wed, 11 May 2022 10:33:45 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 3E8F2289B75 for ; Wed, 11 May 2022 10:33:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MK7LAGAqN3cG for ; Wed, 11 May 2022 10:33:41 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=213.125.118.53; helo=mail.rna.nl; envelope-from=gerben.wierda@rna.nl; receiver= Original-Received: from mail.rna.nl (mail.rna.nl [213.125.118.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 9FD62287CBF for ; Wed, 11 May 2022 10:33:41 +0200 (CEST) Original-Received: from smtpclient.apple (hermione.rna.nl [192.168.2.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.rna.nl (Postfix) with ESMTPSA id 08C3AD679725; Wed, 11 May 2022 10:33:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rna.nl; s=dkim_rsa2048; t=1652258018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=g8LXnJDF2m9qXVCUanUmEnW7DDBeS4vcSPBoWNq9x2Q=; b=hCHdsPyA3k4WE88jXBEBKpIYLLNPACCdoZ8ulxJcx8jbxsB+VqXliDDIKzMdrR+9qZDs4H vZ3tTcHWxtTQeYvNPkPQgcE6HAIABBpZ4Vr+jTm6qZye1gxXY1eUmlt79KD7JMVnUAUB6Q 0X3b2yRNmid5iVLH+x7MDMshj8oe5VHuG12oWpt0ILZGPYk63TfK16GHBpE7BS4s+vcTgF fZMp86fURWIyj/WUzukA71JnBwcCTnraXegLYfK3bEdCn5Elmts6WE7+pPvOLzq/r5wE8p ZQhjriRDHLDg9lFsGwgjfInGKLEtV3kUD+1/EbF7pefYYYfoybYcAgokhJvKmA== In-Reply-To: X-Mailer: Apple Mail (2.3693.60.0.1.1) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:114923 Archived-At: --===============8146753520697124565== Content-Type: multipart/alternative; boundary="Apple-Mail=_54784B79-1301-45F9-9F9B-D05854077118" --Apple-Mail=_54784B79-1301-45F9-9F9B-D05854077118 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 11 May 2022, at 02:37, Rik Kabel via ntg-context = wrote: >=20 > On 2022-05-10 17:39, Gerben Wierda via ntg-context wrote: >> Example. Call with=20 >>=20 >> context =E2=80=94mode=3DFR >>=20 >> - Uncomment the first commented lines. Compilation fails because mode = FR is on so that works >>=20 >> But I get English anyway. Uncomment the second commented part and it = fails, but it should not because mode=3DEN is not turned on. >>=20 >> %\startmode[FR] >> % \BLURBONE >> % \stopmode >>=20 >> \startnotallmodes[FR,RU]% english is the default >> \enablemode[EN] >> \stopnotallmodes >>=20 >> \startmode[EN] >> % \BLURBTWO >> \setuplanguage[en][patterns=3D{en}] >> = \setupexternalfigure[directory=3D../LMTX-Output/without-ids/en/ArchiMate = 3.1 Metamodel ESv4] >> \stopmode >> \startmode[FR] >> \setuplanguage[fr][patterns=3D{en,fr}] >> = \setupexternalfigure[directory=3D../LMTX-Output/without-ids/fr/ArchiMate = 3.1 Metamodel ESv4] >> \stopmode >> \startmode[RU] >> \setuplanguage[ru][patterns=3D{en,ru}] >> = \setupexternalfigure[directory=3D../LMTX-Output/without-ids/ru/ArchiMate = 3.1 Metamodel ESv4] >> \stopmode >>=20 >> Gerben Wierda (LinkedIn ) >> R&A IT Strategy (main site) >> Book: Chess and the Art of Enterprise=C2=A0Architecture = >> Book: Mastering ArchiMate >>=20 > Gerben, >=20 > \startnotallmodes is behaving as it should. Here, it is not the case = that RU and FR (all the listed modes) are set, so EN is enabled, and you = actually have both FR and EN set. >=20 > Try the following with=20 >=20 > context =E2=80=94mode=3DFR >=20 > and make sure you understand the result. >=20 > \starttext > \doifmode{EN}{EN is enabled\par} > \doifmode{FR}{FR is enabled\par} > \doifmode{RU}{RU is enabled\par} > \doifmode{FR,RU}{at least one of FR and RU modes is enabled\par} > \doifmode{EN,RU}{at least one of EN and RU modes is enabled\par} > \doifmode{EN,FR}{at least one of EN and FR modes is enabled\par} > \doifmode{EN,FR,RU}{at least one of EN, FR, and RU modes is = enabled\par} > \doifnotmode{EN}{EN is not enabled\par} > \doifnotmode{FR}{FR is not enabled\par} > \doifnotmode{RU}{RU is not enabled\par} > \doifnotmode{EN,RU}{neither EN nor RU is enabled\par} > \doifnotmode{EN,FR}{neither EN nor FR is enabled\par} > \doifnotmode{RU,FR}{neither RU nor FR is enabled\par} > \doifnotallmodes{FR,RU}{all of FR and RU modes are not enabled\par} > \doifnotallmodes{EN,RU}{all of EN and RU modes are not enabled\par} > \doifnotallmodes{EN,FR}{all of EN and FR modes are not enabled\par} > \doifnotallmodes{EN,FR,RU}{all of EN, FR, and RU modes are not = enabled\par} > \stoptext >=20 > Then, add the following block to the beginning of the file and try = again. >=20 > \definemode[EN,FR,RU][keep] > \doifmodeelse{EN} > { \disablemode[FR] > \disablemode[RU]} > {\doifmodeelse{FR} > { \disablemode[EN] > \disablemode[RU]} > {\doifmodeelse{RU} > { \disablemode[EN] > \disablemode[FR]}} > { \enablemode[EN]}} >=20 >=20 > I find it useful to add such a block to the environment of every file = that uses mutually-exclusive modes. This version pf the block sets a = default value if none is on the command line. >=20 Thanks. It seems that the last part has a {}-issue. \enablemode[EN] is = always wxecuted if on the commandline only FR or RU is set=20 \definemode[EN,FR,RU][keep] \doifmodeelse{EN} { \disablemode[FR] \disablemode[RU] } { \doifmodeelse{FR} { \disablemode[EN] \disablemode[RU] } { \doifmodeelse{RU} { \disablemode[EN] \disablemode[FR] } } { \enablemode[EN] } } I am now using \doifmodeelse{EN} { \disablemode[FR] \disablemode[RU] } { \doifmodeelse{FR} { \disablemode[EN] \disablemode[RU] } { \doifmodeelse{RU} { \disablemode[EN] \disablemode[FR] } { \enablemode[EN] } } } > --=20 > Rik >=20 >=20 >=20 >=20 >=20 >=20 >=20 > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > maillist : ntg-context@ntg.nl / = http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > = __________________________________________________________________________= _________ --Apple-Mail=_54784B79-1301-45F9-9F9B-D05854077118 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On = 11 May 2022, at 02:37, Rik Kabel via ntg-context <ntg-context@ntg.nl> = wrote:

=20 =20
On 2022-05-10 17:39, Gerben Wierda = via ntg-context wrote:
Example. Call with 

context =E2=80=94mode=3DFR

- Uncomment the first commented lines. Compilation fails because mode FR is on so that works

But I get English anyway. Uncomment the second commented part and it fails, but it should not because mode=3DEN is not turned on.

%\startmode[FR]
%  \BLURBONE
%  \stopmode

\startnotallmodes[FR,RU]% english is the = default
\enablemode[EN]
\stopnotallmodes

\startmode[EN]
%  \BLURBTWO
\setuplanguage[en][patterns=3D{en}]
\setupexternalfigure[directory=3D../LMTX-Output/without-ids/en/= ArchiMate 3.1 Metamodel ESv4]
\stopmode
\startmode[FR]
\setuplanguage[fr][patterns=3D{en,fr}]
\setupexternalfigure[directory=3D../LMTX-Output/without-ids/fr/= ArchiMate 3.1 Metamodel ESv4]
\stopmode
\startmode[RU]
\setuplanguage[ru][patterns=3D{en,ru}]
\setupexternalfigure[directory=3D../LMTX-Output/without-ids/ru/= ArchiMate 3.1 Metamodel ESv4]
\stopmode


Gerben,

\startnotallmodes = is behaving as it should. Here, it is not the case that RU and FR (all the listed modes) are set, so EN is enabled, and you actually have both FR and EN set.

Try the following with

context =E2=80=94mode=3DFR

and make sure you understand the = result.

\starttext
\doifmode{EN}{EN is enabled\par}
\doifmode{FR}{FR is enabled\par}
\doifmode{RU}{RU is enabled\par}
\doifmode{FR,RU}{at least one of FR and RU modes is enabled\par}
\doifmode{EN,RU}{at least one of EN and RU modes is enabled\par}
\doifmode{EN,FR}{at least one of EN and FR modes is enabled\par}
\doifmode{EN,FR,RU}{at least one of EN, FR, and RU modes is enabled\par}
\doifnotmode{EN}{EN is not enabled\par}
\doifnotmode{FR}{FR is not enabled\par}
\doifnotmode{RU}{RU is not enabled\par}
\doifnotmode{EN,RU}{neither EN nor RU is enabled\par}
\doifnotmode{EN,FR}{neither EN nor FR is enabled\par}
\doifnotmode{RU,FR}{neither RU nor FR is enabled\par}
\doifnotallmodes{FR,RU}{all of FR and RU modes are not enabled\par}
\doifnotallmodes{EN,RU}{all of EN and RU modes are not enabled\par}
\doifnotallmodes{EN,FR}{all of EN and FR modes are not enabled\par}
\doifnotallmodes{EN,FR,RU}{all of EN, FR, and RU modes are not enabled\par}
\stoptext

Then, add the following block to the = beginning of the file and try again.

\definemode[EN,FR,RU][keep]
\doifmodeelse{EN}
  {    \disablemode[FR]
       \disablemode[RU]}
  {\doifmodeelse{FR}
   {   \disablemode[EN]
       \disablemode[RU]}
   {\doifmodeelse{RU}
     { \disablemode[EN]
       \disablemode[FR]}}
     { \enablemode[EN]}}


I find it useful to add such a block to = the environment of every file that uses mutually-exclusive modes. This version pf the block sets a default value if none is on the command line.


Thanks. = It seems that the last part has a {}-issue. \enablemode[EN] is always = wxecuted if on the commandline only FR or RU is set 

\definemode[EN,FR,RU][keep]
\doifmodeelse{EN}
  = {
    = \disablemode[FR]
    = \disablemode[RU]
  = }
  = {
    = \doifmodeelse{FR}
    = {
      = \disablemode[EN]
    =   \disablemode[RU]
  =   }
    = {
      = \doifmodeelse{RU}
    =   {
    =     \disablemode[EN]
        = \disablemode[FR]
    =   }
    = }
    = {
      = \enablemode[EN]
    = }
  = }

I am now = using

\doifmodeelse{EN}
  = {
    = \disablemode[FR]
    = \disablemode[RU]
  = }
  = {
    = \doifmodeelse{FR}
    = {
      = \disablemode[EN]
    =   \disablemode[RU]
  =   }
    = {
      = \doifmodeelse{RU}
    =   {
    =     \disablemode[EN]
        = \disablemode[FR]
    =   }
    =   {
    =     \enablemode[EN]
      }
    }
  = }

--
Rik




= __________________________________________________________________________= _________
If your question is of interest to others as = well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : = https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
_______________________________________________________________= ____________________

= --Apple-Mail=_54784B79-1301-45F9-9F9B-D05854077118-- --===============8146753520697124565== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============8146753520697124565==--