all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Babel - display results in an overlay?
@ 2010-08-03 17:03 Taru Karttunen
  2010-08-03 17:19 ` Samuel Wales
  2010-08-03 17:44 ` Eric Schulte
  0 siblings, 2 replies; 3+ messages in thread
From: Taru Karttunen @ 2010-08-03 17:03 UTC (permalink / raw)
  To: org-mode mailing list

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Babel - display results in an overlay?
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Wales @ 2010-08-03 17:19 UTC (permalink / raw)
  To: Taru Karttunen; +Cc: org-mode mailing list

Calc allows something like this.

On 2010-08-03, Taru Karttunen <taruti@taruti.net> wrote:
> 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
>


-- 
Q: How many CDC "scientists" does it take to change a lightbulb?
A: "You only think it's dark." [CDC has denied a deadly disease for 25 years]
==========
Retrovirus: http://www.wpinstitute.org/xmrv/index.html -- PLEASE DONATE
===
PNAS must publish the original Lo and Alter NIH/FDA XMRV paper
verbatim along with the new paper.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Babel - display results in an overlay?
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Schulte @ 2010-08-03 17:44 UTC (permalink / raw)
  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 <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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-03 17:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.