emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Babel - display results in an overlay?


From: Eric Schulte
Subject: Re: [Orgmode] Babel - display results in an overlay?
Date: Tue, 03 Aug 2010 11:44:14 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

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 <address@hidden> 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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]