From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/103101 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rik Kabel Newsgroups: gmane.comp.tex.context Subject: Bidi-related register problem Date: Thu, 24 Jan 2019 20:36:17 -0500 Message-ID: <75c1c14d-fd00-c9f2-ac21-782a1fbeed47@rik.users.panix.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3253068493730425962==" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="206483"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Jan 25 02:36:42 2019 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gmqQD-000rbV-B9 for gctc-ntg-context-518@m.gmane.org; Fri, 25 Jan 2019 02:36:41 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B1426D5852; Fri, 25 Jan 2019 02:36: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 uqpGGDqOCNNw; Fri, 25 Jan 2019 02:36:23 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id F3628D587A; Fri, 25 Jan 2019 02:36:22 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 681B4D5879 for ; Fri, 25 Jan 2019 02:36:22 +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 wjmMh6mhO8Rp for ; Fri, 25 Jan 2019 02:36:21 +0100 (CET) Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 13245D586B for ; Fri, 25 Jan 2019 02:36:21 +0100 (CET) Original-Received: from [192.168.201.199] (cpe-24-194-22-135.nycap.res.rr.com [24.194.22.135]) by mailbackend.panix.com (Postfix) with ESMTPSA id 43m1nv4JF0z1DRm for ; Thu, 24 Jan 2019 20:36:19 -0500 (EST) Content-Language: en-US X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.20 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.org gmane.comp.tex.context:103101 Archived-At: This is a multi-part message in MIME format. --===============3253068493730425962== Content-Type: multipart/alternative; boundary="------------E3E1B69009F9D6594CB0ED60" Content-Language: en-US This is a multi-part message in MIME format. --------------E3E1B69009F9D6594CB0ED60 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Recent betas have introduced a bidi-related problem with register processing. In the following example, compilation generates a recoverable error when register processing has to trim an entry to fit maxwidth. The error is: luatex warning  > node filter: error: ...eXt/tex/texmf-context/tex/context/base/mkiv/typo-dub.lua:496: attempt to index local 'stacktop' (a nil value) Removing the maxwidth constraint, or setting it to a much wider value, allows error-free compilation. Without \setupdirections[bidi=on,method=two] there is no problem, but without it RTL texts are not handled properly. This is a recent change; bidi=global worked a few months ago. (I have not tried with LTR text in a default-RTL document). % macros=mkvi \defineregister[Mindex] \setupregister [Mindex] [n=2, maxwidth=4cm, balance=no] \starttexdefinition unexpanded MIndex \dosinglegroupempty\doMIndex \stoptexdefinition \starttexdefinition unexpanded doMIndex #MARKER \def\Marker{#MARKER}% \dosinglegroupempty\doMIndexFull \stoptexdefinition \starttexdefinition doMIndexFull #ITEM \doifelse{#ITEM}{} {\expanded{\Mindex{\Marker}}} {\expanded{\Mindex{\Marker+#ITEM}}} \stoptexdefinition \setupdirections [bidi=on,method=two] \setupbodyfont [libertinus,11pt] \starttext \startparagraph \MIndex{One}{Mairzy doats and dozy doats and liddle lamzy divey} \input jojomayer \stopparagraph \startparagraph סלאם שלום \stopparagraph \placeregister[Mindex] \stoptext -- Rik Kabel --------------E3E1B69009F9D6594CB0ED60 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Recent betas have introduced a bidi-related problem with register processing.

In the following example, compilation generates a recoverable error when register processing has to trim an entry to fit maxwidth. The error is:

luatex warning  > node filter: error: ...eXt/tex/texmf-context/tex/context/base/mkiv/typo-dub.lua:496: attempt to index local 'stacktop' (a nil value)

Removing the maxwidth constraint, or setting it to a much wider value, allows error-free compilation.

Without \setupdirections[bidi=on,method=two] there is no problem, but without it RTL texts are not handled properly. This is a recent change; bidi=global worked a few months ago. (I have not tried with LTR text in a default-RTL document).

% macros=mkvi
\defineregister[Mindex]
\setupregister [Mindex]
               [n=2,
                maxwidth=4cm,
                balance=no]

\starttexdefinition unexpanded MIndex
  \dosinglegroupempty\doMIndex
\stoptexdefinition

\starttexdefinition unexpanded doMIndex #MARKER
  \def\Marker{#MARKER}%
  \dosinglegroupempty\doMIndexFull
\stoptexdefinition

\starttexdefinition doMIndexFull #ITEM
  \doifelse{#ITEM}{}
    {\expanded{\Mindex{\Marker}}}
    {\expanded{\Mindex{\Marker+#ITEM}}}
\stoptexdefinition

\setupdirections [bidi=on,method=two]

\setupbodyfont   [libertinus,11pt]

\starttext

\startparagraph
  \MIndex{One}{Mairzy doats and dozy doats and liddle lamzy divey}

  \input jojomayer 

\stopparagraph

\startparagraph
סלאם שלום
\stopparagraph

\placeregister[Mindex]
\stoptext

--
Rik Kabel


--------------E3E1B69009F9D6594CB0ED60-- --===============3253068493730425962== 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 X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============3253068493730425962==--