From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/116797 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rik Kabel via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: \autoinsertedspace fails Date: Wed, 4 Jan 2023 17:10:58 -0500 Message-ID: <44990e16-0a82-ee19-abed-8b588ac42b8d@rik.users.panix.com> References: <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="===============2739059145748869026==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9536"; 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.1 Cc: Rik Kabel To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 04 23:11:43 2023 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 1pDBz3-0002EA-Hv for gctc-ntg-context-518@m.gmane-mx.org; Wed, 04 Jan 2023 23:11:41 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A50F7380436; Wed, 4 Jan 2023 23:11:09 +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 sGEq6KWN--wK; Wed, 4 Jan 2023 23:11:07 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id DE75C3803F5; Wed, 4 Jan 2023 23:11:07 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9D0563803F5 for ; Wed, 4 Jan 2023 23:11:05 +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 ClMNXMgAxB_V for ; Wed, 4 Jan 2023 23:11:02 +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 AE20D380395 for ; Wed, 4 Jan 2023 23:11:02 +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 4NnP1x0Q4Kz4NLG for ; Wed, 4 Jan 2023 17:11:01 -0500 (EST) Content-Language: en-US In-Reply-To: <86830236-f8d8-cbdd-ff24-d14f9a35f90e@rik.users.panix.com> 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:116797 Archived-At: This is a multi-part message in MIME format. --===============2739059145748869026== Content-Type: multipart/alternative; boundary="------------DyxinANz0EFXCe0GD3oH96cn" Content-Language: en-US This is a multi-part message in MIME format. --------------DyxinANz0EFXCe0GD3oH96cn Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit No change with the latest (2023.01.04). Is this a problem with what I am doing, or a bug? -- Rik On 2022-12-29 19:12, Rik Kabel via ntg-context wrote: > > 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 > > > > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the Wiki! > > maillist :ntg-context@ntg.nl /https://www.ntg.nl/mailman/listinfo/ntg-context > webpage :https://www.pragma-ade.nl /http://context.aanhet.net > archive :https://bitbucket.org/phg/context-mirror/commits/ > wiki :https://contextgarden.net > ___________________________________________________________________________________ --------------DyxinANz0EFXCe0GD3oH96cn Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

No change with the latest (2023.01.04).

Is this a problem with what I am doing, or a bug?

--
Rik

On 2022-12-29 19:12, Rik Kabel via ntg-context wrote:

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



___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________
--------------DyxinANz0EFXCe0GD3oH96cn-- --===============2739059145748869026== 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== --===============2739059145748869026==--