From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/100627 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 08:03:13 -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="0-182309509-1523966595=:36662" X-Trace: blaine.gmane.org 1523966510 24238 195.159.176.226 (17 Apr 2018 12:01:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Apr 2018 12:01:50 +0000 (UTC) User-Agent: Alpine 2.20 (OSX 67 2015-01-07) Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Tue Apr 17 14:01:46 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 1f8PIw-0006Cy-3K for gctc-ntg-context-518@m.gmane.org; Tue, 17 Apr 2018 14:01:46 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1AA41626274; Tue, 17 Apr 2018 14:03:40 +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 okdACasVqR2o; Tue, 17 Apr 2018 14:03:39 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 4231A62626A; Tue, 17 Apr 2018 14:03:39 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5A57D62626A for ; Tue, 17 Apr 2018 14:03:38 +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 p91dGSqHwxd5 for ; Tue, 17 Apr 2018 14:03:33 +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 066FD626269 for ; Tue, 17 Apr 2018 14:03:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=relay-2016-05-12; t=1523966593; bh=NfKrxhfJhVCS119B9Y2VNmBZBRthw1CXgBww0TqSimw=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=RpaMtSvj9ANiTz5HnJOcJ+HjlRs2HwwGzf/G8ECHBxIFOjYswn+ZcbfK3WBC8u8z4 xHauxvUwjkGIB8XyIJNmiGj3/7uU5pvFjxSRr2Rr6K5JscWfeZoRL2iGvovccgkGMf zklactF+I20/lVBGB2BEOZ5K/ituWWboQjxS2GMNTTFZkymw+F8xoib8s8HQuGTpTs YlAqCAky1wJAK/PVqbHjPsqCvO5maIGYGVlcSSGvgH9HJ+dPp+4kYxNzvuufW1rsr/ YZ35PwtZXfHTVzEWcYfvru34eeaU1MfAVpLNbXIYqIk6Tp0r+edgSfmCF6xdi3O5C3 MXIMbaMDzYc2A== Authentication-Results: maleficent.mr.itd.umich.edu; iprev=pass policy.iprev=198.84.249.206 (198-84-249-206.cpe.teksavvy.com); auth=pass smtp.auth=adityam Original-Received: FROM [192.168.0.11] (198-84-249-206.cpe.teksavvy.com [198.84.249.206]) By maleficent.mr.itd.umich.edu ID 5AD5E281.18C11.29253; Authuser adityam; Tue, 17 Apr 2018 08:03:13 -0400 In-Reply-To: <839d54c0-b10c-4a94-31fc-4651bcb820f8@xs4all.nl> 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:100627 Archived-At: --0-182309509-1523966595=:36662 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE 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 :-). > > \samplefile{ward} > \startnarrower > \samplefile{ward} > \startbuffer[test] > Leading spaces > And some more > \stopbuffer > \typebuffer[test] > \stopnarrower > \samplefile{ward} > > \startbuffer[test] > Leading spaces > And some more > \stopbuffer > \typebuffer[test] > > 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 > > Now, as you're not afraid of low level code: > > \unprotect > > \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 tha= t.=20 > What we can do is this which is still ugly but picking up verbatim is=20 > always ugly: > > \def\buff_start_indeed#1#2#3#4% > {\edef\p_strip{\namedbufferparameter{#1}\c!strip}% > > \normalexpanded{\buff_pickup{#2}{#3}{#4}{}{\buff_stop{#4}}\ifx\p_strip\v!= no\zerocount\else\plusone\fi}} > > \protect I want this to be configurable at runtime and the vim module already has=20 code that enables `strip=3Dyes` and `strip=3Dno` options (I do this via a= =20 function in vim so that it works with both mkii and mkiv; although I don't= =20 think that anyone uses the mkii module any longer). Aditya --0-182309509-1523966595=:36662 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 --0-182309509-1523966595=:36662--