From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/101589 Path: news.gmane.org!.POSTED!not-for-mail From: Rik Kabel Newsgroups: gmane.comp.tex.context Subject: Re: How can I remove a blank leading line from a buffer Date: Tue, 14 Aug 2018 10:46:44 -0400 Message-ID: References: <1cd49a92-b6c9-0c48-d148-c863a503a809@xs4all.nl> <1bcbc82c-b9e3-4055-8e18-4786cdd8cc68@gmail.com> <0adfd084-48ce-f956-383b-3265ed4b5fee@rik.users.panix.com> <01b9ac7b-89d5-7c9d-5b26-4895e37017c5@gmail.com> <48094c7d-5f59-fe1f-2fca-233a51dca3e5@rik.users.panix.com> <13236aa2-5150-6415-efe6-5f7b56f111e7@gmail.com> <6b29bc65-feca-a29a-8300-c9b447076985@rik.users.panix.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5342296197401590818==" X-Trace: blaine.gmane.org 1534257902 30441 195.159.176.226 (14 Aug 2018 14:45:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Aug 2018 14:45:02 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 14 16:44:58 2018 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 esmtp (Exim 4.84_2) (envelope-from ) id 1fpaZ7-0007k2-Bj for gctc-ntg-context-518@m.gmane.org; Tue, 14 Aug 2018 16:44:57 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 2ECD6508F6; Tue, 14 Aug 2018 16:47:00 +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 WV2W7z-IM9JX; Tue, 14 Aug 2018 16:46:59 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 83000508E5; Tue, 14 Aug 2018 16:46:59 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E6DAB508E5 for ; Tue, 14 Aug 2018 16:46:57 +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 tQg8ybeXjHgV for ; Tue, 14 Aug 2018 16:46:57 +0200 (CEST) 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 EF2FB508E3 for ; Tue, 14 Aug 2018 16:46:46 +0200 (CEST) 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 804811C60D; Tue, 14 Aug 2018 10:46:45 -0400 (EDT) In-Reply-To: <6b29bc65-feca-a29a-8300-c9b447076985@rik.users.panix.com> Content-Language: en-US X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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:101589 Archived-At: This is a multi-part message in MIME format. --===============5342296197401590818== Content-Type: multipart/alternative; boundary="------------19C19935FE2F0D56DE1CD8B9" Content-Language: en-US This is a multi-part message in MIME format. --------------19C19935FE2F0D56DE1CD8B9 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 8/13/2018 18:43, Rik Kabel wrote: > On 8/13/2018 15:52, Wolfgang Schuster wrote: >> >> >> Rik Kabel schrieb am 13.08.18 um 20:27: >>> On 8/13/2018 13:46, Wolfgang Schuster wrote: >>>> >>>> \starttext >>>> >>>> \BeforePar{\dontleavehmode\llap{? }}\GotoPar >>>> >>>> \input knuth >>>> >>>> \startnarrower >>>> >>>> \BeforePar{\dontleavehmode\llap{? }}\GotoPar >>>> >>>> \input knuth >>>> >>>> \stopnarrower >>>> >>>> \stoptext >>>> >>>> Wolfgang >>> >>> I am applying it incorrectly, or it does not work with the buffers >>> created by \grabbufferdata: >>> >>> \setupwhitespace[none] >>> \setupindenting[none] >>> \starttexdefinition unexpanded startBufTest >>>   \bgroup >>>   \dosingleempty\dostartBufTest >>> \stoptexdefinition >>> \starttexdefinition dostartBufTest [#SETUPS] >>>   \getrawparameters[BufTest][xx=yy,#SETUPS] >>>   \grabbufferdata[TestBuffer][startBufTest][stopBufTest] >>> \stoptexdefinition >>> \starttexdefinition stopBufTest >>>   \startnarrower[left,right] >>>   \startparagraph >>>     \BeforePar{\dontleavehmode\llap{? }}\GotoPar >>>     \inlinebuffer[TestBuffer] >>>   \stopparagraph >>>   \stopnarrower >>>   \egroup >>> \stoptexdefinition >>> >> >> \starttexdefinition stopBufTest >>   \startnarrower[left,right] >>   \startparagraph >>     \dontleavehmode\llap{? }% >>     \blank[overlay] >>     \inlinebuffer[TestBuffer] >>   \stopparagraph >>   \stopnarrower >>   \egroup >> \stoptexdefinition >> >> >> Wolfgang > > Thank you, Wolfgang. That does it. Note that the % escaping the line > end is not needed (    although it might be needed outside a > \starttexdefinition environment) – the following works as well: > > > \starttexdefinition stopBufTest > >   \startnarrower[left,right] > >   \startparagraph > >     \dontleavehmode{\llap{? }} > >     \blank[overlay] > >     \inlinebuffer[TestBuffer] > >   \stopparagraph > >   \stopnarrower > >   \egroup > > \stoptexdefinition > > Alas, this is not yet a workable solution. It does not work with a layout of grid=tolerant, which I am currently using (although it does work with some other grid settings). For now I will just add empty [] to the startBufTest invocations. I really think, though, that a buffers.strip function would be the way to go, instead of futzing after the damage is done. -- Rik --------------19C19935FE2F0D56DE1CD8B9 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 8/13/2018 18:43, Rik Kabel wrote:
On 8/13/2018 15:52, Wolfgang Schuster wrote:


Rik Kabel schrieb am 13.08.18 um 20:27:
On 8/13/2018 13:46, Wolfgang Schuster wrote:

\starttext

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\startnarrower

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\stopnarrower

\stoptext

Wolfgang

I am applying it incorrectly, or it does not work with the buffers created by \grabbufferdata:

\setupwhitespace[none]
\setupindenting[none]
\starttexdefinition unexpanded startBufTest
  \bgroup
  \dosingleempty\dostartBufTest
\stoptexdefinition
\starttexdefinition dostartBufTest [#SETUPS]
  \getrawparameters[BufTest][xx=yy,#SETUPS]
  \grabbufferdata[TestBuffer][startBufTest][stopBufTest]
\stoptexdefinition
\starttexdefinition stopBufTest
  \startnarrower[left,right]
  \startparagraph
    \BeforePar{\dontleavehmode\llap{? }}\GotoPar
    \inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition

\starttexdefinition stopBufTest
  \startnarrower[left,right]
  \startparagraph
    \dontleavehmode\llap{? }%
    \blank[overlay]
    \inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition


Wolfgang

Thank you, Wolfgang. That does it. Note that the % escaping the line end is not needed (    although it might be needed outside a \starttexdefinition environment) – the following works as well:


\starttexdefinition stopBufTest

  \startnarrower[left,right]

  \startparagraph

    \dontleavehmode{\llap{? }}

    \blank[overlay]

    \inlinebuffer[TestBuffer]

  \stopparagraph

  \stopnarrower

  \egroup

\stoptexdefinition



Alas, this is not yet a workable solution. It does not work with a layout of grid=tolerant, which I am currently using (although it does work with some other grid settings). For now I will just add empty [] to the startBufTest invocations.

I really think, though, that a buffers.strip function would be the way to go, instead of futzing after the damage is done.

--
Rik
--------------19C19935FE2F0D56DE1CD8B9-- --===============5342296197401590818== 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 --===============5342296197401590818==--