From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115199 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerben Wierda via ntg-context Newsgroups: gmane.comp.tex.context Subject: Can I simplify this to some sort of logic so it scales better? Date: Mon, 6 Jun 2022 13:34:22 +0200 Message-ID: <5E55F07E-0E20-4D95-ACF5-35CB4A3F6D72@rna.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Content-Type: multipart/mixed; boundary="===============2531984282950054388==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24051"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gerben Wierda To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 06 13:35: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 1nyB0l-0005tq-26 for gctc-ntg-context-518@m.gmane-mx.org; Mon, 06 Jun 2022 13:35:07 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 483AA64E; Mon, 6 Jun 2022 13:34: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 aCcn0JSr-31Y; Mon, 6 Jun 2022 13:34:26 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D61552A1B34; Mon, 6 Jun 2022 13:34:26 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BAD4D2A1B34 for ; Mon, 6 Jun 2022 13:34:25 +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 hMMFaZUTMr7S for ; Mon, 6 Jun 2022 13:34:24 +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 1C2B264E for ; Mon, 6 Jun 2022 13:34:23 +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 1CF05E71C353 for ; Mon, 6 Jun 2022 13:34:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rna.nl; s=dkim_rsa2048; t=1654515260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=452NRlmA+n2/Tv59MLr8ESWt2zJjsGHq6JVl9FogX8w=; b=aVGnD5xQQK0Sn+z5BSLYqhTviMEGKlJebP3BGExGsyyzc4xmVAs+yzzsqhHPNcHqo3cpbJ WeXqXl4DNZ3+EbP/TnzwTXeZZ6Pbs+xG4fVdmaYpiqXO+lbPQ5QsI2XvGaYndR+DGstdUV dHIVqaxygoRg1hGLxN8m458Daqz6CQ9ec2hbrwz1gyf2+dutl081FpV3koSkp0NWE0kuI3 3YKNmaa2jnEC7shIbuFPx3t4xyhrassnIm+FsNVtdSlwwkPSmfnUmhcnEtLenVYU2w8qPZ HlG2WaG3/wfEkwFKcFNCywIa9ZVhSEGb2t4442OtBMAttjnHnRFn1AFTBqRa7g== X-Mailer: Apple Mail (2.3696.100.31) 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:115199 Archived-At: --===============2531984282950054388== Content-Type: multipart/alternative; boundary="Apple-Mail=_55507FCD-42D3-4A0B-882D-F8BD63FB658E" --Apple-Mail=_55507FCD-42D3-4A0B-882D-F8BD63FB658E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I have this: \definemode[EN,FR,RU,PT][keep] \doifmodeelse{EN} { \disablemode[FR] \disablemode[RU] \disablemode[PT] } { \doifmodeelse{FR} { \disablemode[EN] \disablemode[RU] \disablemode[PT] } { \doifmodeelse{RU} { \disablemode[EN] \disablemode[FR] \disablemode[PT] } { \doifmodeelse{PT} { \disablemode[EN] \disablemode[FR] \disablemode[RU] } { \enablemode[EN] } } } } But for every language added this becomes more and more complex. I was = wondering what would be a good approach to simplify it.=20 I want to make sure that one and only one of these modes is active and = that if no mode is entered on the command line the mode is EN. Gerben Wierda (LinkedIn ) R&A IT Strategy (main site) Book: Chess and the Art of Enterprise=C2=A0Architecture = Book: Mastering ArchiMate --Apple-Mail=_55507FCD-42D3-4A0B-882D-F8BD63FB658E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii I = have this:

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

But for every language added this becomes more and more = complex. I was wondering what would be a good approach to simplify = it. 

I = want to make sure that one and only one of these modes is active and = that if no mode is entered on the command line the mode is EN.


= --Apple-Mail=_55507FCD-42D3-4A0B-882D-F8BD63FB658E-- --===============2531984282950054388== 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== --===============2531984282950054388==--