From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: [BUG] src_blocks - :results raw and replace don't work together Date: Mon, 07 Jul 2014 13:04:14 +0200 Message-ID: <8738edig5t.fsf@gmail.com> References: <87vbraroza.fsf@gmail.com> <877g3pcw4j.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X46io-0005r7-Fw for emacs-orgmode@gnu.org; Mon, 07 Jul 2014 07:04:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X46ii-0004so-DR for emacs-orgmode@gnu.org; Mon, 07 Jul 2014 07:04:34 -0400 Received: from plane.gmane.org ([80.91.229.3]:56859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X46ii-0004sX-6r for emacs-orgmode@gnu.org; Mon, 07 Jul 2014 07:04:28 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1X46ig-0006f7-S9 for emacs-orgmode@gnu.org; Mon, 07 Jul 2014 13:04:26 +0200 Received: from e178189211.adsl.alicedsl.de ([85.178.189.211]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Jul 2014 13:04:26 +0200 Received: from tjolitz by e178189211.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Jul 2014 13:04:26 +0200 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Thorsten Jolitz writes: > Andreas Leha writes: > >> Hi Thorsten, >> >> Thorsten Jolitz writes: >> >>> Hi List, >>> >>> evaluating this 3 times does not work as expected: >>> >>> ,---- >>> | * A >>> | >>> | #+header: :results raw replace >>> | #+begin_src emacs-lisp >>> | (+ 2 2) >>> | #+end_src >>> | >>> | #+results: >>> | 4 >>> | 4 >>> | 4 >>> `---- >>> >>> Independent from argument order, 'replace' (which should be default >>> anyway) is ignored. >> >> >> Try adding the :wrap, which works for me: >> >> ,---- >> | * A >> | >> | #+header: :results raw replace :wrap >> | #+begin_src emacs-lisp >> | (+ 2 2) >> | #+end_src >> | >> | #+results: >> | #+BEGIN_RESULTS >> | 4 >> | #+END_RESULTS >> `---- > > This actually works here too, thanks. But is this wrapping results block > 'neutral', i.e. is its content treated just like raw Org syntax in all > situations? E.g. when I create a dblock from elisp, would > > #+results: > #+BEGIN_RESULTS > #+begin my-dblock > (foo) > #+end > #+END_RESULTS > > be equivalent to > > #+results: > #+begin my-dblock > (foo) > #+end > > in all cases? > > However, the combo ':results raw replace' seems like the natural fit > when programmatically creating content in an Org file with a src_block > that might eventually be evaluated more than once. That it does not work > 'as-is' seems too much of a surprise to not call it a bug (at least when > the manual does not mention it as special case). My use-case is actually this, and it won't work with wrapped results: ,---- | ** Utility Function :ARCHIVE: | | #+name: create-subtree-with-dblock | #+header: :var name="foo" | #+header: :var prms=":bar loo" | #+header: :results replace raw | #+begin_src emacs-lisp | (format | (concat "\n\n** Overview :READONLY:\n\n" | "#+begin: %s %s\n\n#+end:\n") | name prms) | #+end_src | | #+results: dblock | | | ** Overview :READONLY: | | #+begin: foo :bar loo | | #+end: `---- -- cheers, Thorsten