From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/100629 Path: news.gmane.org!.POSTED!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Problem with Filter Module in latent context beta Date: Tue, 17 Apr 2018 13:19:03 -0400 (EDT) Message-ID: References: <6C002DD0-884E-4D8B-AD82-0A9538E19091@toppkieker.info> <4b0ff8f5-b975-8178-b820-540b2e3006d8@xs4all.nl> <839d54c0-b10c-4a94-31fc-4651bcb820f8@xs4all.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8323328-1887686477-1523985544=:14129" X-Trace: blaine.gmane.org 1523985441 25451 195.159.176.226 (17 Apr 2018 17:17:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Apr 2018 17:17:21 +0000 (UTC) User-Agent: Alpine 2.21.99 (LNX 239 2017-12-04) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Apr 17 19:17:17 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 1f8UEG-0006V8-EF for gctc-ntg-context-518@m.gmane.org; Tue, 17 Apr 2018 19:17:16 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5CF136260B1; Tue, 17 Apr 2018 19:19:20 +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 S6W5zC_FD3VI; Tue, 17 Apr 2018 19:19:19 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 791B7626037; Tue, 17 Apr 2018 19:19:19 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 63C43626035 for ; Tue, 17 Apr 2018 19:19:18 +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 TZ6tvx4TypKP for ; Tue, 17 Apr 2018 19:19:17 +0200 (CEST) Original-Received: from maleficent.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.125.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id B58D0626037 for ; Tue, 17 Apr 2018 19:19:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=relay-2016-05-12; t=1523985545; bh=r5rdvN2/1we+RFjzTAJe+w5jVmRa5UCMThbxxPKP2lU=; h=Date:From:To:Subject:In-Reply-To:References; b=Xoe1qEIlK+COLYZyt6aEmdPIyiqJyiZ3YCQdwtl5ucOpuEDcvOzakujB/YlvQO54r veBwEfjapnUSF+ujcTjcXPCgtqJGpTaOi4qDcS+LXWEkBb/L6XOru38s5a8v1NGVQl uMizNT33ghXM8Z8njgxfQvGBQbgUbxydKc/gf2ADJcS5LgLE5/X8YITnXN/V5G6V5i 78kBylO+VcqOGGWg9FW3mkweW1oFXxKnBXmPq/PUyd515/zJwFA/+HFNvJSOKDqDjM iEYnoHygCDi8cjl3Q038/heAFgNXx+c7oSnXkzNUjdkVoebloz7f7RfETwMrc3iBbA MK4su+VwYtbOg== Authentication-Results: maleficent.mr.itd.umich.edu; iprev=permerror policy.iprev=132.206.69.142 (unknown); auth=pass smtp.auth=adityam Original-Received: FROM decentralized (unknown [132.206.69.142]) By maleficent.mr.itd.umich.edu ID 5AD62C88.C6857.21929; Authuser adityam; Tue, 17 Apr 2018 13:19:04 -0400 In-Reply-To: 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:100629 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1887686477-1523985544=:14129 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Tue, 17 Apr 2018, Aditya Mahajan wrote: > On Tue, 17 Apr 2018, Hans Hagen wrote: > >> On 4/17/2018 12:01 AM, Aditya Mahajan wrote: >>> All features of the filter and vim modules work with the latest beta,= =20 >>> except for one final bug: leading spaces are stripped from the buffer. >>>=20 >>> \starttext >>>=20 >>> \startbuffer[test] >>> =C2=A0=C2=A0=C2=A0 Leading spaces >>> \stopbuffer >>>=20 >>> \savebuffer[file=3Dtest-temp.tmp, prefix=3Dno, list=3Dtest] >>>=20 >>> \stoptext >>>=20 >>> The leading spaces are stripped before the buffer is saved to the file= =20 >>> temp.tmp. Is it possible for the leading space NOT to be stripped? (If= =20 >>> not, I'll just document this as a feature :-). >>=20 >> \samplefile{ward} >> \startnarrower >> \samplefile{ward} >> \startbuffer[test] >> Leading spaces >> And some more >> \stopbuffer >> \typebuffer[test] >> \stopnarrower >> \samplefile{ward} >>=20 >> \startbuffer[test] >> Leading spaces >> And some more >> \stopbuffer >> \typebuffer[test] >>=20 >> it is actually a feature to align the left edge relative to the least=20 >> indented so that we can use them inside other constructs >>=20 >> Now, as you're not afraid of low level code: >>=20 >> \unprotect >>=20 >> \unexpanded\def\StartAditya >> {\buff_pickup >> {Aditya}% >> {StartAditya}% >> {StopAditya}% >> {}% >> {\savebuffer[file=3Dtest-temp.tmp,prefix=3Dno,list=3DAditya]}% >> \zerocount} > > This is perfect as I am already using `\grabbufferdata` in my code. I can= =20 > easily adapt it to use `\buff_pickup` instead. Thanks!. > >> Does what you want but of course it's sort of ugly for a module to do th= at.=20 >> What we can do is this which is still ugly but picking up verbatim is=20 >> always ugly: >>=20 >> \def\buff_start_indeed#1#2#3#4% >> {\edef\p_strip{\namedbufferparameter{#1}\c!strip}% >>=20 >> \normalexpanded{\buff_pickup{#2}{#3}{#4}{}{\buff_stop{#4}}\ifx\p_strip\v= !no\zerocount\else\plusone\fi}} >>=20 >> \protect > I want this to be configurable at runtime and the vim module already has = code=20 > that enables `strip=3Dyes` and `strip=3Dno` options (I do this via a func= tion in=20 > vim so that it works with both mkii and mkiv; although I don't think that= =20 > anyone uses the mkii module any longer). I added `strip=3Dyes` option to the filter module, which is now the default= =20 option. See "Stripping leading whitespace" in the module documentation=20 (https://github.com/adityam/filter). This is a MkIV only feature and I=20 will not implement it in MkII. I also made `strip=3Dyes` to be the default in t-vim (to be consistent with= =20 t-filter). In t-vim, the `strip` option works with both mkii and mkiv. Aditya --8323328-1887686477-1523985544=:14129 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 --8323328-1887686477-1523985544=:14129--