From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/114918 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rik Kabel via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Does \startnotallmodes work? Date: Tue, 10 May 2022 20:37:14 -0400 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9186306244996765250==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3691"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.8.1 Cc: Rik Kabel To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed May 11 02:38:10 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 1noaMk-0000oU-4l for gctc-ntg-context-518@m.gmane-mx.org; Wed, 11 May 2022 02:38:10 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CD087289E52; Wed, 11 May 2022 02:37:29 +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 Zdsv9laQEJPc; Wed, 11 May 2022 02:37:26 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6B6B7289E58; Wed, 11 May 2022 02:37:26 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 82C51289E55 for ; Wed, 11 May 2022 02:37:24 +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 cBCa23TebmHt for ; Wed, 11 May 2022 02:37:22 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=166.84.1.89; helo=mailbackend.panix.com; envelope-from=rik@panix.com; receiver= Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) (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 2FC2A289E52 for ; Wed, 11 May 2022 02:37:21 +0200 (CEST) Original-Received: from [192.168.1.106] (cpe-69-204-136-231.nycap.res.rr.com [69.204.136.231]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4Kybb25ybpz3tS1 for ; Tue, 10 May 2022 20:37:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=panix.com; s=panix; t=1652229438; bh=hGubO4pfFMkOdd0w/L4rerG0f7kwloD4H2iZq90K83Q=; h=Date:Subject:To:References:From:In-Reply-To; b=s9iIwnUTdu/YBxcnsNQDL+jziNdkCIYu+BlMVAvFVRri6KxhX8rugBy9W7UoZUaIg scnXQEZE9emr11OTp+ceKxKOsU+v+CIYM9X+PeQkQfwj7j60MMbTy2UAcpFu5suyDT mWr5Mf2F6VDmzdpwx92lw2aMbyXD57RNTk6S33ws= Content-Language: en-US In-Reply-To: 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:114918 Archived-At: This is a multi-part message in MIME format. --===============9186306244996765250== Content-Type: multipart/alternative; boundary="------------eeRc03yv0fFjrQ6nBgpDnvO0" Content-Language: en-US This is a multi-part message in MIME format. --------------eeRc03yv0fFjrQ6nBgpDnvO0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2022-05-10 17:39, Gerben Wierda via ntg-context wrote: > Example. Call with > > context —mode=FR > > - 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=EN is not turned on. > > %\startmode[FR] > %  \BLURBONE > %  \stopmode > > \startnotallmodes[FR,RU]% english is the default > \enablemode[EN] > \stopnotallmodes > > \startmode[EN] > %  \BLURBTWO > \setuplanguage[en][patterns={en}] > \setupexternalfigure[directory=../LMTX-Output/without-ids/en/ArchiMate > 3.1 Metamodel ESv4] > \stopmode > \startmode[FR] > \setuplanguage[fr][patterns={en,fr}] > \setupexternalfigure[directory=../LMTX-Output/without-ids/fr/ArchiMate > 3.1 Metamodel ESv4] > \stopmode > \startmode[RU] > \setuplanguage[ru][patterns={en,ru}] > \setupexternalfigure[directory=../LMTX-Output/without-ids/ru/ArchiMate > 3.1 Metamodel ESv4] > \stopmode > > Gerben Wierda (LinkedIn ) > R&A IT Strategy  (main site) > Book: Chess and the Art of Enterprise Architecture > > Book: Mastering ArchiMate > 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 —mode=FR 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. -- Rik --------------eeRc03yv0fFjrQ6nBgpDnvO0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 2022-05-10 17:39, Gerben Wierda via ntg-context wrote:
Example. Call with 

context —mode=FR

- 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=EN is not turned on.

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

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

\startmode[EN]
%  \BLURBTWO
\setuplanguage[en][patterns={en}]
\setupexternalfigure[directory=../LMTX-Output/without-ids/en/ArchiMate 3.1 Metamodel ESv4]
\stopmode
\startmode[FR]
\setuplanguage[fr][patterns={en,fr}]
\setupexternalfigure[directory=../LMTX-Output/without-ids/fr/ArchiMate 3.1 Metamodel ESv4]
\stopmode
\startmode[RU]
\setuplanguage[ru][patterns={en,ru}]
\setupexternalfigure[directory=../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 —mode=FR

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.

--
Rik




--------------eeRc03yv0fFjrQ6nBgpDnvO0-- --===============9186306244996765250== 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== --===============9186306244996765250==--