emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] "global" variables in a babel document...


From: Allen S. Rout
Subject: [O] "global" variables in a babel document...
Date: Tue, 17 May 2016 15:24:00 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

org-version
org "8.2.10"
emacs-version
"24.5.1"


I'm seeing what seems to be some inconsistent treatment of :var header
args.  Or maybe I'm just missing something.   I'm trying to follow:

http://orgmode.org/manual/Header-arguments-in-Org-mode-properties.html#Header-arguments-in-Org-mode-properties

and I find that the local :var works (of course) and the outline level
one also works, but the document-level one does not.

Minimal example, with my results, below.

I'm wondering if I'm thinking about the problem wrong.  What I'm trying
to accomplish is setting, at a document level, a few variables which I
would like to be accessible in every code block in this document.

I know I can set them independently on every block, but that seems
tiresome.


- Allen S. Rout

-----
#+PROPERTY:header-args    :var tsmuser="query"

* foo
 :PROPERTIES:
 :header-args: :var tsmpass="query"
 :END:

#+name: toy
#+begin_src sh :var bloop="foo"
echo sss ${bloop} ddd
echo sss ${tsmpass} ddd
echo sss ${tsmuser} ddd
#+end_src

#+RESULTS: toy
| sss | foo   | ddd |
| sss | query | ddd |
| sss | ddd   |     |
-----





reply via email to

[Prev in Thread] Current Thread [Next in Thread]