From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: inline code block results Date: Fri, 04 Feb 2011 13:29:21 -0700 Message-ID: <87mxmb1q27.fsf@gmail.com> References: <4D4C2595.1080907@med.uni-goettingen.de> <4D4C2836.5010306@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=56053 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlSd0-0002Z0-J0 for emacs-orgmode@gnu.org; Fri, 04 Feb 2011 15:51:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlScz-0003hq-9B for emacs-orgmode@gnu.org; Fri, 04 Feb 2011 15:51:38 -0500 Received: from mail-yx0-f169.google.com ([209.85.213.169]:43441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlScz-0003hJ-6o for emacs-orgmode@gnu.org; Fri, 04 Feb 2011 15:51:37 -0500 Received: by mail-yx0-f169.google.com with SMTP id 31so1295013yxl.0 for ; Fri, 04 Feb 2011 12:51:36 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Dan Davison Cc: Andreas Leha , emacs-orgmode@gnu.org Dan Davison writes: > Andreas Leha writes: > >> Hi all, >> >> just found out: the inline block works when I explicitly state :results >> replace. >> >> So both questions from the previous email collapse to: why is that >> necessary? >> >> Regards, >> Andreas >> >> >> >> Am 04.02.2011 17:13, schrieb Andreas Leha: >>> Hi all, >>> >>> I have two questions: >>> >>> (1) How do I get resuts from code block evaluation (e.g. a single >>> number) inline into text during (LaTeX-)export? Something like: We use >>> a level of #+call: getLevel() >>> >>> (2) Why do these two subheadings produce different output during >>> (LaTeX-)export? >>> * Test >>> ** Normal source code block >>> The number is >>> #+srcname: success_parameter_one >>> #+begin_src R :session :results value :exports results >>> tmp <- rnorm(1) >>> #+end_src >>> >>> ** Inline source code block >>> The number is src_R[:session :results value :exports results]{tmp <- >>> rnorm(1)} > > Hi Andreas, > > This is a bug, thanks. They should both produce the number (and no code) > in the exported material. > > It bisects to d0ca215105 which is a recent commit re-working export of > inline- and regular src blocks. I believe the fix may be as below but > I'll let Eric S check that. > > Note that in your inline src block :results value and :exports results > are usually unnecessary, as they are the default values for inline src > blocks. > Yes, I've just applied this change. Note that the variables like `org-babel-default-*-header-args' are intended for users to customize in their local config, so don't shy away from changing the default settings locally. I think I set the default to silent thinking that whenever I would interactively execute an inline code block, I would want to see the results in the message area, rather than actually insert them inline. Best -- Eric > > Dan > > diff --git a/lisp/ob.el b/lisp/ob.el > index b899410..3fecbbd 100644 > --- a/lisp/ob.el > +++ b/lisp/ob.el > @@ -297,7 +297,7 @@ specific header arguments as well.") > "Default arguments to use when evaluating a source block.") > > (defvar org-babel-default-inline-header-args > - '((:session . "none") (:results . "silent") (:exports . "results")) > + '((:session . "none") (:results . "replace") (:exports . "results")) > "Default arguments to use when evaluating an inline source block.") > > (defvar org-babel-current-buffer-properties nil > > > >>> >>> >>> Thanks in advance! >>> Andreas >>> >>>