From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/110900 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christoph Reller Newsgroups: gmane.comp.tex.context Subject: Re: Typing within doifmode leads to error Date: Sat, 20 Mar 2021 06:24:03 +0100 Message-ID: References: <41b732e4-b771-15a2-7fc1-5ead8086f4f9@xs4all.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7470558924809902100==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5360"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Sat Mar 20 06:25:09 2021 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 1lNU6m-0001Hb-HE for gctc-ntg-context-518@m.gmane-mx.org; Sat, 20 Mar 2021 06:25:08 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id DC27E2818F3; Sat, 20 Mar 2021 06:24:23 +0100 (CET) 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 DZjYk0r7FTFZ; Sat, 20 Mar 2021 06:24:22 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 04EA72818F5; Sat, 20 Mar 2021 06:24:22 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A44522818F0 for ; Sat, 20 Mar 2021 06:24:20 +0100 (CET) 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 IYVOSYI3T0jD for ; Sat, 20 Mar 2021 06:24:20 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.167.51; helo=mail-lf1-f51.google.com; envelope-from=christoph.reller@gmail.com; receiver= Original-Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id EC21A281363 for ; Sat, 20 Mar 2021 06:24:19 +0100 (CET) Original-Received: by mail-lf1-f51.google.com with SMTP id x28so13239044lfu.6 for ; Fri, 19 Mar 2021 22:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lmB5BkpK+kfnaob7d8bOf2BlwYmhqSuqgG4trGNkT8A=; b=UM80vUGw0qAigutGRazZOCqNKOIPyB/end/RDsKXKX9SrHSdusCGaIgnG9MkLbwAKm TdAHt72pmS9F+gsc5Il756n/wYXQibWYo4/wMz+9Ozs9xqQJoW248QjvBLWpKHSWfAZg ONPwRyR350CcY2WLwc1KoLeqbjSxi69RfNGZ5C1DsuFjrM9x1GKKlnpXZMi+RUIWTLOz zvYe0stuTn3oCCjWl0/ZYQxDmzXvDybepeQMJS5bDb0V5HKh8rHhwdRUnz7acCpkydMO 2647+V3hTur1wGcOceqAWb8jHgo6YwFzSaOIN6LlwEL4ct8/bXX04VENretby012viWL fG8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lmB5BkpK+kfnaob7d8bOf2BlwYmhqSuqgG4trGNkT8A=; b=DWldy609ewSciN6VXb89wsFhw+4FV1gdWBvHQSDe8uIYJa/UStr9UTtAT0d/djcQZm GvusETBYXlyyC4KspBGR4ZZ+0D8kbQfBHJR5xGCdXTJ/3Ww/ce9yN3n47iWKtdaYd1rN Q4vXnm4XOdVL6fhyfEQlwwehNmb8MbiWAn+fO6iqnB4bFrXIh5ZFQ5NwFnXqnXRAkVHR Pwca1gFWOvyHk8gFJEHRiTyLNtYAL8E8ed1uLrqijGl48Y0EOGqenRA8BHfBr/IuJdZq DCnAHewnnnrsw7r7WHnb1I+u0T1paVg1d62ak21y+0X7JKKzWGex4DViix3UafgyNY7e eGlA== X-Gm-Message-State: AOAM53275m8mUSLo076pUWXGpoo1ENPuTl5fra8hrnr0iXXT0rq9tzZf juJl1ER+AX7q9BM9jbs2xANqhyzXKItxRsl+XeY= X-Google-Smtp-Source: ABdhPJz2r2l3mpxGw7jNYip2D8yr5A0FD4DRpQimqHVi5PJASeFWsjEPKdeX899wIigWJCb0QrOq4/irmT+qEj1YB+E= X-Received: by 2002:ac2:5446:: with SMTP id d6mr2820319lfn.527.1616217859171; Fri, 19 Mar 2021 22:24:19 -0700 (PDT) In-Reply-To: <41b732e4-b771-15a2-7fc1-5ead8086f4f9@xs4all.nl> 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:110900 Archived-At: --===============7470558924809902100== Content-Type: multipart/alternative; boundary="00000000000060279005bdf10b2c" --00000000000060279005bdf10b2c Content-Type: text/plain; charset="UTF-8" On Fri, Mar 19, 2021 at 9:49 AM Hans Hagen wrote: > On 3/19/2021 4:58 AM, Christoph Reller wrote: > > Hi, > > > > Consider the following MWE: > > > > \definetyping[T] > > \definemode[mode][yes] > > \starttext > > \doifmode{mode}{% > > \startT > > Bla > > \stopT} > > \stoptext > > > > Compilation with the currently latest ConTeXt LMTX (ver: 2021.03.17 > > 17:46 LMTX fmt: 2021.3.18) fails with: > > > > tex error > runaway error: end of file encountered > > mtx-context | fatal error: return code: 1 > > > > Compilation is successful if I replace doifmode{mode}{...} by > > \startmode[mode]...\stopmode. > > > > Is there anything I'm missing? (This could be a bug.) > not a bug, just the way tex works .. modes cannot know that what goes > into an argument is something verbose > > but you can use this (also more efficient here): > > \definetyping[T] > \definemode[mode][yes] > \starttext > \startmode[mode] > \startT > Bla > \stopT > \stopmode > \stoptext > > % there's also \startnotmode > > Thank you for hinting at the environment form. The problem with this is, that it cannot be nested, and that there is no "else" form. E.g: \startmode[A] ... mode A \startmode[B] ... mode A and mode B \elsemode ... mode A and not mode B \stopmode \stopmode I know that there is \start(not)mode and \start(not)allmodes, but there seems to be no way to use a general boolean expression such as: \startmodes[A and not B] ... \stopmodes Of course we can do this in lua: if tex.modes["A"] and not tex.modes{"B"] then ... end Keep up your excellent work! Cheers, Christoph --00000000000060279005bdf10b2c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Mar 19, 2021 at 9:49 AM Hans Hage= n <j.hagen@xs4all.nl> wrote:=
On 3/19/2021 4:58 AM, Christoph Reller wrote:
> Hi,
>
> Consider the following MWE:
>
> \definetyping[T]
> \definemode[mode][yes]
> \starttext
> \doifmode{mode}{%
>=C2=A0 =C2=A0 \startT
>=C2=A0 =C2=A0 =C2=A0 Bla
>=C2=A0 =C2=A0 \stopT}
> \stoptext
>
> Compilation with the currently latest ConTeXt LMTX (ver: 2021.03.17 > 17:46 LMTX =C2=A0fmt: 2021.3.18) fails with:
>
> tex error =C2=A0 =C2=A0 =C2=A0 > runaway error: end of file encount= ered
> mtx-context =C2=A0 =C2=A0 | fatal error: return code: 1
>
> Compilation is successful if I replace doifmode{mode}{...} by
> \startmode[mode]...\stopmode.
>
> Is there anything I'm=C2=A0missing? (This could be a bug.)
not a bug, just the way tex works .. modes cannot know that what goes
into an argument is something verbose

but you can use this (also more efficient here):

\definetyping[T]
\definemode[mode][yes]
\starttext
\startmode[mode]
\startT
=C2=A0 =C2=A0 =C2=A0Bla
\stopT
\stopmode
\stoptext

% there's also \startnotmode


Th= ank you for hinting at the environment form. The problem with this is, that= it cannot be nested, and that there is no "else" form.
E.g:

\startmode[A]
... mode A
\startmode[B]
... mode A and mode B
\elsemode
... mode A and not mode B
\stopmode
\stopmode=C2=A0

I know that there is \start(not)mode and \start(not= )allmodes, but there seems to be no way to use a general boolean expression= such as:

\startmodes[A and not B]
...
\stopmodes

Of course we can do this in lu= a:

if tex.modes["A"] and not tex.modes{&= quot;B"] then
...
end

Kee= p up your excellent work! Cheers,

Christoph
<= /div>
--00000000000060279005bdf10b2c-- --===============7470558924809902100== 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== --===============7470558924809902100==--