From: Miguel Ruiz <rbenit68@openmailbox.org>
To: "Allen S. Rout" <asr@ufl.edu>, Emacs Orgmode <emacs-orgmode@gnu.org>
Subject: Re: "global" variables in a babel document...
Date: Thu, 19 May 2016 10:55:58 +0200 [thread overview]
Message-ID: <6a0996213d7b9ca15a8e931c4ec967f9@openmailbox.org> (raw)
In-Reply-To: <nhfr4k$p1q$1@ger.gmane.org>
This works for me, but if you change tsmuser value in session, you have
to C-c C-c in PROPERTY line, getting "Local setup have been refreshed".
#+PROPERTY: 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 | query | ddd |
Best regards.
El 2016-05-17 21:24, Allen S. Rout escribió:
> 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 | |
> -----
prev parent reply other threads:[~2016-05-19 8:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-17 19:24 "global" variables in a babel document Allen S. Rout
2016-05-18 16:50 ` Nicolas Goaziou
2016-05-19 8:55 ` Miguel Ruiz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6a0996213d7b9ca15a8e931c4ec967f9@openmailbox.org \
--to=rbenit68@openmailbox.org \
--cc=asr@ufl.edu \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).