From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Babel - display results in an overlay? Date: Tue, 03 Aug 2010 11:44:14 -0600 Message-ID: <87aap3twt1.fsf@gmail.com> References: <871vafljbr.fsf@hydra.violetti.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=52131 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OgLYM-0007dB-Gd for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 13:45:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OgLYI-000379-87 for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 13:45:26 -0400 Received: from mail-yx0-f169.google.com ([209.85.213.169]:59779) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OgLYI-00036z-3q for emacs-orgmode@gnu.org; Tue, 03 Aug 2010 13:45:22 -0400 Received: by yxs7 with SMTP id 7so2282098yxs.0 for ; Tue, 03 Aug 2010 10:45:21 -0700 (PDT) In-Reply-To: <871vafljbr.fsf@hydra.violetti.org> (Taru Karttunen's message of "Tue, 03 Aug 2010 20:03:36 +0300") 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: Taru Karttunen Cc: org-mode mailing list Hi Taru, Babel can be used for storing and manipulating values of variables, and Babel already has a syntax for referencing these things inline in an Org-mode buffer using inline code blocks. The syntax of an inline code block is src_lang[optional header arguments]{code body} The following property can be used to to ensure that all of your inline blocks are evaluated in the same session #+property: session *R* then you can use any programming language which your system supports to handle the variable assignment and manipulation (R is used below). e.g. : foo is src_R{foo <- 1+3} and bar is src_R{bar <- foo+3} would export to : foo is 4 and bar is 7 There is currently no support for replacing a code block with an overlay of it's results, but such a function may not be too difficult to write. Take a look at the `org-babel-open-src-block-result' function which has related functionality. This would be a generally useful feature -- the ability to replace all code blocks in a buffer with an overlay of their results (possibly with some colored background indicating that the results are actually the product of a code block). I'm interested to see what you come up with -- Eric Taru Karttunen writes: > Hello > > I am looking for an org-mode solution to storing a number of variables and > referencing them nicely in an org-mode buffer. > > I would like to write something like this: > "{foo:1+3} and {bar:foo+3}" > and have it displayed (with overlays) as: > "foo:4 and bar:7" > > Any ideas how to hack org and babel to do this. Simple numeric > operations suffice but I have a few dozen variables so an easy > an intuitive interface is the most important aspect. > > - Taru Karttunen > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode