emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [tables, babel] evaluate code block in table with arguments
@ 2011-07-26  9:12 Dirk Scharff
  2011-07-26 12:12 ` Sebastien Vauban
  0 siblings, 1 reply; 3+ messages in thread
From: Dirk Scharff @ 2011-07-26  9:12 UTC (permalink / raw)
  To: emacs-orgmode list

Hi all,

I want to use a code-block in a table and can't get it to work. Consider the following example: 

--------------------------------------------------------
#+Source: the_test
#+begin_src python :var x=3 :results output
print x
#+end_src

| argument | argument | result |
|        1 |        1 | #ERROR |
|        2 |        2 |        |
#+TBLFM: $2=$<::$3=call_the_test(x=$<)
--------------------------------------------------------

How can I address the the argument on the left hand side of the table while calling a code block? If I do it like shown in the example (column 2) I get the following error:
"reference '$<' not found in this buffer".

Isn't this possible in org-mode or am I doing something wrong?

Regards,
Dirk.

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

* Re: [tables, babel] evaluate code block in table with arguments
  2011-07-26  9:12 [tables, babel] evaluate code block in table with arguments Dirk Scharff
@ 2011-07-26 12:12 ` Sebastien Vauban
  2011-07-26 13:53   ` Dirk Scharff
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastien Vauban @ 2011-07-26 12:12 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Dirk,

Dirk Scharff wrote:
> I want to use a code-block in a table and can't get it to work. [...]
> Isn't this possible in org-mode or am I doing something wrong?

Use `sbe' to make calls inside tables; see
http://osdir.com/ml/emacs-orgmode-gnu/2011-07/msg00540.html

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [tables, babel] evaluate code block in table with arguments
  2011-07-26 12:12 ` Sebastien Vauban
@ 2011-07-26 13:53   ` Dirk Scharff
  0 siblings, 0 replies; 3+ messages in thread
From: Dirk Scharff @ 2011-07-26 13:53 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

Hi Sebastien,

thanks for pointing me to that macro. $3='(sbe the_test( x $< )) does
exactly what I wanted.

best regards,

Dirk


On Tue, Jul 26, 2011 at 2:12 PM, Sebastien Vauban <
wxhgmqzgwmuf@spammotel.com> wrote:

> Hi Dirk,
>
> Dirk Scharff wrote:
> > I want to use a code-block in a table and can't get it to work. [...]
> > Isn't this possible in org-mode or am I doing something wrong?
>
> Use `sbe' to make calls inside tables; see
> http://osdir.com/ml/emacs-orgmode-gnu/2011-07/msg00540.html
>
> Best regards,
>  Seb
>
> --
> Sebastien Vauban
>
>
>

[-- Attachment #2: Type: text/html, Size: 1100 bytes --]

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

end of thread, other threads:[~2011-07-26 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-26  9:12 [tables, babel] evaluate code block in table with arguments Dirk Scharff
2011-07-26 12:12 ` Sebastien Vauban
2011-07-26 13:53   ` Dirk Scharff

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