emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Assigning results to variables
@ 2012-03-25  1:39 Neuwirth Erich
  2012-03-25  2:09 ` Nick Dokos
  2012-03-25  8:22 ` Erich Neuwirth
  0 siblings, 2 replies; 4+ messages in thread
From: Neuwirth Erich @ 2012-03-25  1:39 UTC (permalink / raw)
  To: emacs-orgmode

Is it possible to assign the results of a babel code block to a variable?
Then the results produce by one language could be transferred as input to a code block in another language.
I studied the documentation and could not find any hint about this.

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

* Re: Assigning results to variables
  2012-03-25  1:39 Assigning results to variables Neuwirth Erich
@ 2012-03-25  2:09 ` Nick Dokos
  2012-03-25  8:22 ` Erich Neuwirth
  1 sibling, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2012-03-25  2:09 UTC (permalink / raw)
  To: Neuwirth Erich; +Cc: nicholas.dokos, emacs-orgmode

Neuwirth Erich <erich.neuwirth@univie.ac.at> wrote:

> Is it possible to assign the results of a babel code block to a
> variable?  Then the results produce by one language could be
> transferred as input to a code block in another language.  I studied
> the documentation and could not find any hint about this.
> 

Here's a very simple example:

--8<---------------cut here---------------start------------->8---

* chaining calculations

#+name: foo
#+BEGIN_SRC elisp
(+ 3 4)
#+END_SRC

#+RESULTS: foo
: 7

#+BEGIN_SRC elisp :var x=foo
(* x x)
#+END_SRC

#+RESULTS:
: 49
--8<---------------cut here---------------end--------------->8---

Nick

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

* Re: Assigning results to variables
  2012-03-25  1:39 Assigning results to variables Neuwirth Erich
  2012-03-25  2:09 ` Nick Dokos
@ 2012-03-25  8:22 ` Erich Neuwirth
  2012-03-26 11:42   ` Eric Schulte
  1 sibling, 1 reply; 4+ messages in thread
From: Erich Neuwirth @ 2012-03-25  8:22 UTC (permalink / raw)
  To: emacs-orgmode

Thanks,
that is exactly what I need.
Perhaps this trick could explicitly mentioned in the documentation.

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

* Re: Assigning results to variables
  2012-03-25  8:22 ` Erich Neuwirth
@ 2012-03-26 11:42   ` Eric Schulte
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Schulte @ 2012-03-26 11:42 UTC (permalink / raw)
  To: Erich Neuwirth; +Cc: emacs-orgmode

Erich Neuwirth <erich.neuwirth@univie.ac.at> writes:

> Thanks,
> that is exactly what I need.
> Perhaps this trick could explicitly mentioned in the documentation.
>

It is, see http://orgmode.org/manual/var.html.

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

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

end of thread, other threads:[~2012-03-26 14:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-25  1:39 Assigning results to variables Neuwirth Erich
2012-03-25  2:09 ` Nick Dokos
2012-03-25  8:22 ` Erich Neuwirth
2012-03-26 11:42   ` Eric Schulte

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).