From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/116761 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rik Kabel via ntg-context Newsgroups: gmane.comp.tex.context Subject: \autoinsertedspace fails Date: Thu, 29 Dec 2022 19:12:08 -0500 Message-ID: <86830236-f8d8-cbdd-ff24-d14f9a35f90e@rik.users.panix.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7292225742802485307==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33988"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.6.0 Cc: Rik Kabel To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Dec 30 01:12:44 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 1pB30u-0008ff-9L for gctc-ntg-context-518@m.gmane-mx.org; Fri, 30 Dec 2022 01:12:44 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5BA813802A6; Fri, 30 Dec 2022 01:12:18 +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 u94WsPwPSqqW; Fri, 30 Dec 2022 01:12:15 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7553938029C; Fri, 30 Dec 2022 01:12:15 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0DDC238016E for ; Fri, 30 Dec 2022 01:12:14 +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 YQjVO4y3VgiB for ; Fri, 30 Dec 2022 01:12:11 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=166.84.1.89; helo=mailbackend.panix.com; envelope-from=context@rik.users.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 625F138008F for ; Fri, 30 Dec 2022 01:12:11 +0100 (CET) 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 4Njm0V1q2mzNTl for ; Thu, 29 Dec 2022 19:12:10 -0500 (EST) Content-Language: en-US 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:116761 Archived-At: This is a multi-part message in MIME format. --===============7292225742802485307== Content-Type: multipart/alternative; boundary="------------BniBDZV7uq0ve9Flk0SgXWVl" Content-Language: en-US This is a multi-part message in MIME format. --------------BniBDZV7uq0ve9Flk0SgXWVl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Happy New Year all! Following up on the problem with \autoinsertnextspace (https://mailman.ntg.nl/pipermail/ntg-context/2022/107111.html) and the new \autoinsertedspace that came from that report, I see that there is still a problem, or perhaps a problem again after it was previously repaired. The following code, run under the latest (and recent previous) version, produces an incorrect result, with no space inserted where expected in many cases. As the first examples after \starttext show, the problem appears to be with \autoinsertedspace, but perhaps I am using it incorrectly in the macro as well. \starttexdefinition unexpanded BD   \dodoublegroupempty   \doBD \stoptexdefinition \starttexdefinition doBD #1#2    \removeunwantedspaces\ % insert a space    (    \ifsecondargument        #1|–|#2    \else\iffirstargument        #1–    \else        {\red I NEED A DATE OR DATES!}    \fi\fi    )    \autoinsertedspace \stoptexdefinition \tt \starttext This\autoinsertedspace fails unexpectedly with autoinsertedspace.\par This\autoinsertedspace \emph{fails unexpectedly} with autoinsertedspace.\par This\autoinsertnextspace works with autoinsertnextspace.\par This\autoinsertnextspace \emph{fails} as expected with autoinsertnextspace.\par Saussure\BD{1857}{1913} works.\par Saussure \BD{1857}{1913} \emph{works}.\par Saussure \BD{1857}{1913}. Works.\par Chomsky\BD{1928} fails with LMTX, works with MkIV.\par Chomsky \BD{1928} \emph{fails with LMTX, works with MkIV}.\par Chomsky \BD{1928}. Works.\par \BD blah\par \contextversion\ \texenginename \stoptext -- Rik --------------BniBDZV7uq0ve9Flk0SgXWVl Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Happy New Year all!

Following up on the problem with \autoinsertnextspace (https://mailman.ntg.nl/pipermail/ntg-context/2022/107111.html) and the new \autoinsertedspace that came from that report, I see that there is still a problem, or perhaps a problem again after it was previously repaired.

The following code, run under the latest (and recent previous) version, produces an incorrect result, with no space inserted where expected in many cases. As the first examples after \starttext show, the problem appears to be with \autoinsertedspace, but perhaps I am using it incorrectly in the macro as well.

\starttexdefinition unexpanded BD
  \dodoublegroupempty
  \doBD
\stoptexdefinition

\starttexdefinition doBD #1#2
   \removeunwantedspaces\ % insert a space
   (
   \ifsecondargument
       #1|–|#2
   \else\iffirstargument
       #1–
   \else
       {\red I NEED A DATE OR DATES!}
   \fi\fi
   )
   \autoinsertedspace
\stoptexdefinition

\tt

\starttext
This\autoinsertedspace fails unexpectedly with autoinsertedspa
ce.\par
This\autoinsertedspace \emph{fails unexpectedly} with autoinsertedspace.\par
This\autoinsertnextspace works with autoinsertnextspace.\par
This\autoinsertnextspace \emph{fails} as expected with autoinsertnextspace.\par
Saussure\BD{1857}{1913} works.\par
Saussure \BD{1857}{1913} \emph{works}.\par
Saussure \BD{1857}{1913}. Works.\par
Chomsky\BD{1928} fails with LMTX, works with MkIV.\par

Chomsky \BD{1928} \emph{fails with LMTX, works with MkIV}.\par
Chomsky \BD{1928}. Works.\par
\BD blah\par
\contextversion\ \texenginename
\stoptext


--
Rik


--------------BniBDZV7uq0ve9Flk0SgXWVl-- --===============7292225742802485307== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cHM6Ly93d3cubnRnLm5sL21haWxtYW4v bGlzdGluZm8vbnRnLWNvbnRleHQKd2VicGFnZSAgOiBodHRwczovL3d3dy5wcmFnbWEtYWRlLm5s IC8gaHR0cDovL2NvbnRleHQuYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHBzOi8vYml0YnVja2V0 Lm9yZy9waGcvY29udGV4dC1taXJyb3IvY29tbWl0cy8Kd2lraSAgICAgOiBodHRwczovL2NvbnRl eHRnYXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============7292225742802485307==--