From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Arthur A. Gleckler" Subject: send block evaluation results to specified buffer Date: Wed, 11 Sep 2019 18:14:59 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000067e349059250de33" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:39481) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8DhZ-0001nf-EW for emacs-orgmode@gnu.org; Wed, 11 Sep 2019 21:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8DhX-0003n0-TZ for emacs-orgmode@gnu.org; Wed, 11 Sep 2019 21:15:13 -0400 Received: from mail-io1-f52.google.com ([209.85.166.52]:33697) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i8DhX-0003mA-Kr for emacs-orgmode@gnu.org; Wed, 11 Sep 2019 21:15:11 -0400 Received: by mail-io1-f52.google.com with SMTP id m11so50597655ioo.0 for ; Wed, 11 Sep 2019 18:15:11 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --00000000000067e349059250de33 Content-Type: multipart/alternative; boundary="00000000000067e346059250de31" --00000000000067e346059250de31 Content-Type: text/plain; charset="UTF-8" Attached is a patch to allow one to specify that results from executing a block should go to a specific buffer. When a :buffer is specified, output goes to that buffer, which is erased first, e.g.: #+begin_src sh :results buffer :buffer *foo* echo foo #+end_src When no :buffer is specified, buffer *org results* is used, e.g.: #+begin_src sh :results buffer echo foo #+end_src I've tried to follow the conventions for contributions to Org mode, buf if I've missed something, please let me know. (I'm happy to sign the FSF paperwork.) Thank you for Org mode! --00000000000067e346059250de31 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Attached is a patch to allow one to specify that results f= rom executing a block should go to a specific buffer.

When a=C2=A0:buffer=C2=A0is specified, output goes to tha= t buffer, which is erased first, e.g.:

=C2= =A0 #+begin_src sh :results buffer :buffer *foo*
=C2=A0 echo foo
=C2= =A0 #+end_src


When no :buffer is specified, buffer=C2=A0*org results*=C2=A0is used, e.g.:

=C2=A0 #+begin_src sh :results buffer
=C2=A0 echo foo<= br>=C2=A0 #+end_src

I've tried to follow the = conventions for contributions to Org mode, buf if I've missed something= , please=C2=A0let me know.=C2=A0 (I'm happy to sign the FSF paperwork.)=

Thank you for Org=C2=A0mode!
--00000000000067e346059250de31-- --00000000000067e349059250de33 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-ob-core.el-block-result-output-to-buffer.patch" Content-Disposition: attachment; filename="0001-ob-core.el-block-result-output-to-buffer.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_k0g01yk70 RnJvbSA1MmRlNTRiOGNmNWI5MWFjMDFkM2E1NjZiM2MxY2E2MTc2YTljYjFkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiAiQXJ0aHVyIEEuIEdsZWNrbGVyIiA8YWFnQGFsdW0ubWl0LmVk dT4KRGF0ZTogV2VkLCAxMSBTZXAgMjAxOSAxNzowMzozMyAtMDcwMApTdWJqZWN0OiBbUEFUQ0hd IG9iLWNvcmUuZWw6IGJsb2NrIHJlc3VsdCBvdXRwdXQgdG8gYnVmZmVyCgoqIGxpc3Avb2ItY29y ZS5lbCAob3JnLWJhYmVsLWV4ZWN1dGUtc3JjLWJsb2NrKTogU3VwcG9ydCBidWZmZXJzLgpBbGxv dyBzcGVjaWZ5aW5nIHRoYXQgcmVzdWx0cyBmcm9tIGV4ZWN1dGluZyBhIGJsb2NrIHNob3VsZCBn byB0byBhCmJ1ZmZlci4KCldoZW4gYSA6YnVmZmVyIGlzIHNwZWNpZmllZCwgb3V0cHV0IGdvZXMg dG8gdGhhdCBidWZmZXIsIH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