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 17:44:04 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000d6efee0592506f9c" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35012) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8DDe-000513-5r for emacs-orgmode@gnu.org; Wed, 11 Sep 2019 20:44:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8DDc-0000tl-V1 for emacs-orgmode@gnu.org; Wed, 11 Sep 2019 20:44:17 -0400 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]:39425) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i8DDc-0000td-N7 for emacs-orgmode@gnu.org; Wed, 11 Sep 2019 20:44:16 -0400 Received: by mail-io1-xd34.google.com with SMTP id d25so50461848iob.6 for ; Wed, 11 Sep 2019 17:44:16 -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 --000000000000d6efee0592506f9c Content-Type: multipart/alternative; boundary="000000000000d6efec0592506f9a" --000000000000d6efec0592506f9a 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 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! --000000000000d6efec0592506f9a 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 :buffer is specified, output goes to that buffer, = which is erased first, e.g.:

=C2=A0 #+begin= _src sh :results buffer
=C2=A0 echo foo
=C2=A0 #+end_src

When no :buffer is specified, buffer *org result= s* is used, e.g.:

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

<= /div>
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&= #39;m happy to sign the FSF paperwork.)

Thank you = for Org mode!
--000000000000d6efec0592506f9a-- --000000000000d6efee0592506f9c Content-Type: application/x-patch; 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_k0fydh3f0 RnJvbSA5MjliMWFlMmY5MDhiMzlkZTUyOTM4NGE1ODU0ZmM1YjhkMDM1MjgyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiAiQXJ0aHVyIEEuIEdsZWNrbGVyIiA8YWFnQGFsdW0ubWl0LmVk dT4KRGF0ZTogV2VkLCAxMSBTZXAgMjAxOSAxNzowMzozMyAtMDcwMApTdWJqZWN0OiBbUEFUQ0hd IG9iLWNvcmUuZWw6IGJsb2NrIHJlc3VsdCBvdXRwdXQgdG8gYnVmZmVyCgoqIGxpc3Avb2ItY29y ZS5lbCAob3JnLWJhYmVsLWV4ZWN1dGUtc3JjLWJsb2NrKTogU3VwcG9ydCBidWZmZXJzLgpBbGxv dyBzcGVjaWZ5aW5nIHRoYXQgcmVzdWx0cyBmcm9tIGV4ZWN1dGluZyBhIGJsb2NrIHNob3VsZCBn byB0byBhCmJ1ZmZlci4KCldoZW4gYSA6YnVmZmVyIGlzIHNwZWNpZmllZCwgb3V0cHV0IGdvZXMg dG8gdGhhdCBidWZmZXIsIHdoaWNoIGlzCmVyYXNlZCBmaXJzd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