From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/99816 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: add to \setbuffer Date: Wed, 10 Jan 2018 18:30:14 +0100 Message-ID: <5A564DA6.7000504@gmail.com> References: <426E8AAE-DA54-4658-9FE4-62121D5D20AB@ziggo.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3586514905377431264==" X-Trace: blaine.gmane.org 1515605333 9871 195.159.176.226 (10 Jan 2018 17:28:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 10 Jan 2018 17:28:53 +0000 (UTC) User-Agent: Postbox 5.0.22 (Macintosh/20171208) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 10 18:28:49 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 1eZKBB-00025d-PY for gctc-ntg-context-518@m.gmane.org; Wed, 10 Jan 2018 18:28:45 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 91E2B8A13EF; Wed, 10 Jan 2018 18:30:29 +0100 (CET) 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 AlJAckaQN0QH; Wed, 10 Jan 2018 18:30:28 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id DACE88A13FB; Wed, 10 Jan 2018 18:30:28 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 254858A13F9 for ; Wed, 10 Jan 2018 18:30:28 +0100 (CET) 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 IPhK2e_kKqQi for ; Wed, 10 Jan 2018 18:30:27 +0100 (CET) Original-Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com [209.85.128.180]) (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 99EDD8A13EF for ; Wed, 10 Jan 2018 18:30:17 +0100 (CET) Original-Received: by mail-wr0-f180.google.com with SMTP id f8so18127275wre.4 for ; Wed, 10 Jan 2018 09:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=S0TLKcecVPKqcHuBYZeonhA/otzWBLbLYgKCBdzIePg=; b=nbBYRDwz6sGYsTPAc1EODgKQqi0uCWcSnLzA/aAVu8h3pE+GAArcPgL8cum8KSIdkO YjMwH53MjBttulum4ZAmsjGNrj6nTlnI8iBtH8SYB+dusD0PGEsBj1UKdv7ffSZdD2nr KfJzLfyvnv1vDK1WHovNDXcfhoL+bdQ47uK9HyVWiv04v4W4QAmP7DuO8ZXChW7lvkqA LRy3UjSYYZGUDjFst44Zo4r6Aq03tTwPCZ2s5WUul28bi3ZmXLLERkQys95kZxhYHVDe IaOKqLop6ufznE5ic5Rw+WMa86qsnK2Ug8gLll43WdC3LAXJJJtrprah1ngPu2N01TTT 0ANQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=S0TLKcecVPKqcHuBYZeonhA/otzWBLbLYgKCBdzIePg=; b=t2KZmTCEfqJnJ156S76AGRH5W00y1JZFDtzzT22pvU2h4BfliCtFG0aFsKi6C02uMY 0fNV4VogIXAzTBG5y0Enmbw0fyT3U9Uo2Rp8sjLC1S/mIhr1uZqnL1rgKzHpVAaV2UX4 AvWWsbyGl5yaJz4YYVucG1trhCUQmbHue5iz2NAZRgelGvsO1Nx2yQeF9Hryj3Jik3+k lF24bCdRkdzFRfJsc20yYFAr8HIyhxQ2+HnKhLukSW+naT7A1WP6zHH20CrfztQqAdIF Nrlli1NbNwjNSy1bXtwKlEzPXV8xACSNQP0Uim3iDRHMXCcCw5Stqq9CL2QJ3ytwaYpA ck7g== X-Gm-Message-State: AKGB3mI1nqwP7D1dWq/94fRJdv6F/hBNPslbq4rXGdDXsnAjlmJuaVA/ q7qCvsm/aFVYqD90GFVaLEYOgU5A X-Google-Smtp-Source: ACJfBosljV4+nFRhgDTQhTGv6bsD2K8OIHJqCoNyy2My4EswXOhS4zhjAfxIN/CJoP6UiASNJTV1Dg== X-Received: by 10.223.186.148 with SMTP id p20mr17566192wrg.238.1515605416834; Wed, 10 Jan 2018 09:30:16 -0800 (PST) Original-Received: from [192.168.1.9] (x4dbdce62.dyn.telefonica.de. [77.189.206.98]) by smtp.gmail.com with ESMTPSA id e197sm40974334wmf.4.2018.01.10.09.30.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2018 09:30:16 -0800 (PST) In-Reply-To: <426E8AAE-DA54-4658-9FE4-62121D5D20AB@ziggo.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:99816 Archived-At: This is a multi-part message in MIME format. --===============3586514905377431264== Content-Type: multipart/alternative; boundary="------------080405080406090202020207" This is a multi-part message in MIME format. --------------080405080406090202020207 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit > dr. Hans van der Meer > 10. Januar 2018 um 13:45 > With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put > something in this buffer. > But is it possible to add something at the end of this buffer at a > later moment? You can use the “buffers.append” and “buffers.prepend” functions to add text to a buffer. \starttext \startbuffer[a] First \stopbuffer \startbuffer[b] Second \stopbuffer \startbuffer[c] Third \stopbuffer \startluacode buffers.append("b",buffers.getcontent("c")) buffers.prepend("b",buffers.getcontent("a")) \stopluacode \getbuffer[b] \stoptext Wolfgang --------------080405080406090202020207 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
10. Januar 2018 um 13:45
With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put something in this buffer.
But is it possible to add something at the end of this buffer at a later moment?

You can use the “buffers.append” and “buffers.prepend” functions to add text to a buffer.

\starttext

\startbuffer[a]
First
\stopbuffer

\startbuffer[b]
Second
\stopbuffer

\startbuffer[c]
Third
\stopbuffer

\startluacode

buffers.append("b",buffers.getcontent("c"))

buffers.prepend("b",buffers.getcontent("a"))

\stopluacode

\getbuffer[b]

\stoptext

Wolfgang
--------------080405080406090202020207-- --===============3586514905377431264== 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 --===============3586514905377431264==--