emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Taru Karttunen <taruti@taruti.net>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Babel - display results in an overlay?
Date: Tue, 03 Aug 2010 11:44:14 -0600	[thread overview]
Message-ID: <87aap3twt1.fsf@gmail.com> (raw)
In-Reply-To: <871vafljbr.fsf@hydra.violetti.org> (Taru Karttunen's message of "Tue, 03 Aug 2010 20:03:36 +0300")

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 <taruti@taruti.net> 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

      parent reply	other threads:[~2010-08-03 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-03 17:03 Babel - display results in an overlay? Taru Karttunen
2010-08-03 17:19 ` Samuel Wales
2010-08-03 17:44 ` Eric Schulte [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87aap3twt1.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=taruti@taruti.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).