org.texi: New example on babel :post header

* org.texi (post): Clarification and new example.
This commit is contained in:
rasmus 2015-01-26 18:24:39 +01:00
parent 650278f775
commit ae83b37e3e

View file

@ -15987,10 +15987,11 @@ code block execution. When a post argument is given, the results of the code
block will temporarily be bound to the @code{*this*} variable. This variable block will temporarily be bound to the @code{*this*} variable. This variable
may then be included in header argument forms such as those used in @ref{var} may then be included in header argument forms such as those used in @ref{var}
header argument specifications allowing passing of results to other code header argument specifications allowing passing of results to other code
blocks, or direct execution via Emacs Lisp. blocks, or direct execution via Emacs Lisp. Additional header arguments may
be passed to the @code{:post}-function.
The following example illustrates the usage of the @code{:post} header The following two examples illustrate the usage of the @code{:post} header
argument. argument. The first example shows how to attach a attribute-line via @code{:post}.
@example @example
#+name: attr_wrap #+name: attr_wrap
@ -16015,6 +16016,31 @@ argument.
:END: :END:
@end example @end example
The second examples shows how to use @code{:post} together with the
@code{:colnames} header argument.
@example
#+name: round-tbl
#+begin_src emacs-lisp :var tbl="" fmt="%.3f"
(mapcar (lambda (row)
(mapcar (lambda (cell)
(if (numberp cell)
(format fmt cell)
cell))
row))
tbl)
#+end_src
#+begin_src R :colnames yes :post round-tbl[:colnames yes](*this*)
set.seed(42)
data.frame(foo=rnorm(1))
#+end_src
#+RESULTS:
| foo |
|-------|
| 1.371 |
@end example
@node prologue @node prologue
@subsubsection @code{:prologue} @subsubsection @code{:prologue}
@cindex @code{:prologue}, src header argument @cindex @code{:prologue}, src header argument