babel: variable references which look like lisp forms are now evaluated
commit32bbd3f3bb1bead35b6ce00ecb2cd75cbf869d08
authorEric Schulte <schulte.eric@gmail.com>
Mon, 22 Mar 2010 14:49:35 +0000 (22 08:49 -0600)
committerEric Schulte <schulte.eric@gmail.com>
Mon, 22 Mar 2010 21:19:32 +0000 (22 15:19 -0600)
tree7642ff430dc38678eb3bcccb1473bcb307737ba9
parent19113c46c99d99a93f4c8fc4029a54eaaf2229c2
babel: variable references which look like lisp forms are now evaluated

  for example, the following simple example
    #+begin_src emacs-lisp :var two=(+ 1 1)
      (sqrt two)
    #+end_src

    #+results:
    : 1.4142135623730951

  Or this more interesting usage, which pulls variable values from
  headline properties
    *** example headline w/property
        :PROPERTIES:
        :special:  89
        :last-name: schulte
        :END:

    #+begin_src emacs-lisp :var special=(string-to-number (org-entry-get nil "special" t))
      (+ special 1)
    #+end_src

    #+results:
    : 90

    #+begin_src emacs-lisp :var last-name=(org-entry-get nil "last-name" t))
      (message "hello %s" last-name)
    #+end_src

    #+results:
    : hello schulte
contrib/babel/lisp/org-babel.el