# [NTG-context] Problem with Filter Module in latent context beta

Hans Hagen j.hagen at xs4all.nl
Tue Apr 17 10:09:18 CEST 2018

On 4/17/2018 12:01 AM, Aditya Mahajan wrote:
> All features of the filter and vim modules work with the latest beta,
> except for one final bug: leading spaces are stripped from the buffer.
>
> \starttext
>
> \startbuffer[test]
> \stopbuffer
>
> \savebuffer[file=test-temp.tmp, prefix=no, list=test]
>
> \stoptext
>
> The leading spaces are stripped before the buffer is saved to the file
> temp.tmp. Is it possible for the leading space NOT to be stripped? (If
> not, I'll just document this as a feature :-).

\samplefile{ward}
\startnarrower
\samplefile{ward}
\startbuffer[test]
And some more
\stopbuffer
\typebuffer[test]
\stopnarrower
\samplefile{ward}

\startbuffer[test]
And some more
\stopbuffer
\typebuffer[test]

it is actually a feature to align the left edge relative to the least
indented so that we can use them inside other constructs

Now, as you're not afraid of low level code:

\unprotect

{\buff_pickup
{}%
\zerocount}

{}

\protect

And some more

(1)

(2)

\typefile{test-temp.tmp}

Does what you want but of course it's sort of ugly for a module to do
that. What we can do is this which is still ugly but picking up verbatim
is always ugly:

\unprotect

\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

And some more
And even more

But then we need Wolfgang to double check if this extension has side
effects elsewhere.

Hans

-----------------------------------------------------------------