Open main menu

Changes

1,899 bytes added ,  18:13, 6 September 2020
Created page with "Documentation for \setbuffer ... \endbuffer"
<cd:commandgroup begin="set" end="end" name="buffer" type="environment" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc>The environment <tt>\setbuffer ... \endbuffer</tt> is used for filling a buffer.
</cd:shortdesc>
<cd:variants>
<cd:command begin="set" category="buffer" end="end" file="buff-ini.mkiv" interfacedate="2020-07-14T09:24" interfacefile="i-buffer.xml" level="system" name="buffer" type="environment" variantnumber="1">
<cd:arguments>
<cd:keywords ordinal="1">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:keywords>
</cd:arguments>
</cd:command>
</cd:variants>
<cd:description>This command is very much like {{cmd|setbuffer}} except it takes a less careful (more low-level) approach to collecting the content. It also does not pay attention to the {{cmd|setupbuffer|2=[strip=yes]}} setting; multiple spaces are always collapsed into a single space. Because of this, it is practically useless when {{cmd|typebuffer}} will be used.

If the buffer is fairly well-behaved, must only be typeset, and speed is of the essence, then this is a useful alternative to {{cmd|startbuffer}}.
</cd:description>
<cd:examples><cd:example title=""><context source="yes">

\setupbuffer[strip=yes]

\setbuffer[mybuf]
Some buffered text
extra line
\endbuffer

\getbuffer[mybuf]
\typebuffer[mybuf]

\startbuffer[mybuf]
Some buffered text
extra line
\stopbuffer

\getbuffer[mybuf]
\typebuffer[mybuf]

</context></cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:source file="buff-ini.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Buffer"></cd:wikipage>
<cd:commandref name="startbuffer"></cd:commandref>
<cd:commandref name="typebuffer"></cd:commandref>
<cd:commandref name="getbuffer"></cd:commandref></cd:seealso>
</cd:commandgroup>