From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Alekseyev Subject: Re: [bugs] Export to HTML requires issuing org-babel-execute-buffer; results replace fails Date: Mon, 23 Jan 2012 22:53:42 -0600 Message-ID: References: <87k44is34h.fsf@gmx.com> <87d3a9n3rs.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpYO9-0005GK-7j for emacs-orgmode@gnu.org; Mon, 23 Jan 2012 23:53:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RpYO7-0004bA-Jj for emacs-orgmode@gnu.org; Mon, 23 Jan 2012 23:53:45 -0500 Received: from mail-pw0-f41.google.com ([209.85.160.41]:53375) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpYO7-0004b3-Dn for emacs-orgmode@gnu.org; Mon, 23 Jan 2012 23:53:43 -0500 Received: by pbdu6 with SMTP id u6so2404852pbd.0 for ; Mon, 23 Jan 2012 20:53:42 -0800 (PST) In-Reply-To: <87d3a9n3rs.fsf@gmx.com> 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: Eric Schulte Cc: Emacs orgmode On Mon, Jan 23, 2012 at 10:05 PM, Eric Schulte wrote= : > Leo Alekseyev writes: > >> On Mon, Jan 23, 2012 at 11:58 AM, Eric Schulte wr= ote: >>> Leo Alekseyev writes: >>> >>>> Since all source blocks are evaluated on export, I don't think it >>>> should be necessary to issue org-babel-execute-buffer before invoking >>>> export. =A0However, running HTML export without org-babel-execute-buff= er >>>> currently produces garbage output. >>>> >>> >>> What do you mean by "garbage" output? >> >> That wasn't a very good description, sorry. > > No problem, thanks for clarifying. > > [... moot bug removed ...] > >>> >>> Could you isolate a minimal example demonstrating just the failure of >>> results replacement? >> >> Run the below code a few times with C-c C-v b, and you'll see >> >> ------------snip--------- >> #+property: session *R-babel* >> >> #+NAME: foo >> #+HEADER: :var plot.filename=3D"conv1.png" >> #+BEGIN_SRC R :results output silent >> =A0 cat.fname.link <- function() { cat(plot.filename,"\n",sep=3D"") } >> =A0 cat.fname.link() >> #+END_SRC >> >> src_R[:results output replace]{ cat.fname.link() } >> ------------snip--------- >> >> >> You can also replace src_R with >> >> #+begin_src R :results output raw replace :exports results >> =A0cat.fname.link() >> #+end_src >> >> and it will also fail to replace results. >> >> All the above examples were run with the latest pull of org. >> > > Ah, I see now. =A0Unfortunately it is not possible to replace the results > of inline code blocks. =A0This is because there is no general way to > identify where the results begin and end. =A0Maybe adding [:results > silent] to your inline code blocks would solve the problem. =A0Then you > could evaluate the whole buffer, and could previews the values produced, > but would not have to worry about duplicate results. Yes, that's a good suggestion. Just to be clear, do you consider the following to be an inline block? (I usually think of inline as limited to src_R{ ...} type things). Or are you generally talking about the distinction between #+begin_src / #+end_src lines vs #+call lines? #+begin_src R :results output raw replace :exports results cat.fname.link() #+end_src Finally, in the last file of my original message I try to use #+call's everywhere instead of source blocks. Cleaned up example is pasted below. It looks broken (the first #+call bar is out of order, the second and third #+call bar's don't run), see http://pastebin.com/LqYK0Ps2 with my annotation where the output looks broken ----------snip--------- #+property: session *R-babel* #+NAME: foo #+HEADER: :var a=3D"a1.png" #+BEGIN_SRC R :results output silent cat("in foo block\n") cat.a <- function() { cat(a,"\n",sep=3D"") } cat.a() #+END_SRC #+NAME: bar #+begin_src R :results output raw replace :exports none cat.a() #+end_src Should have all a1 stuff #+call: foo(a=3D"a1.png") #+call: bar() Should have all a2 stuff #+call: foo(a=3D"a2.png") #+call: bar() Should have all a3 stuff #+call: foo(a=3D"a3.png") #+call: bar()