From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: Another tricky question: accessing named values Date: Fri, 14 Sep 2012 11:24:46 +0200 Message-ID: <5052F7DE.7020109@christianmoe.com> References: <9ED226CC-ABB1-4F17-B904-698CDBC193A0@univie.ac.at> <87fw6l2h4c.fsf@altern.org> <297435FE-72E9-4729-ADD8-5A9F3A28566B@univie.ac.at> Reply-To: mail@christianmoe.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCS7E-0007Rb-Gn for emacs-orgmode@gnu.org; Fri, 14 Sep 2012 05:23:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCS78-0004Ui-Sk for emacs-orgmode@gnu.org; Fri, 14 Sep 2012 05:23:12 -0400 Received: from b1.hitrost.net ([91.185.211.67]:16697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCS78-0004Ua-M3 for emacs-orgmode@gnu.org; Fri, 14 Sep 2012 05:23:06 -0400 In-Reply-To: <297435FE-72E9-4729-ADD8-5A9F3A28566B@univie.ac.at> 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: Neuwirth Erich Cc: Bastien , "emacs-orgmode@gnu.org emacs-orgmode@gnu.org" Hi, You could just call the named block from inline: : value equals call_myval()[:results raw] The `:results raw' argument should take care of the formatting. No macros needed. But if you want to use macros, e.g. because the call lines get very long, or you want to add fancy formatting around the result of each calculation (not what you're looking for here, I think), you could write a macro to expand to a call_() expression. Yours, Christian On 9/14/12 10:52 AM, Neuwirth Erich wrote: > Define a name with a value > > #+name: myval > #+begin_src elisp :exports both > (+ 1 2) > #+end_src > > > The named value can be accessed in another code block > > > #+begin_src elisp :session*elisp* :var myval2=myval :exports both > (setq myval3 myval2) > myval2 > #+end_src > > > I can also (with some trickery as shown above) > use the value in running text: value equals > src_elisp[:session*elisp*]{myval3} > > One of the minor annoyances here is that output of the inline src > is always put between equals signs, and in some cases I would like the same > formatting as the surrounding text.