From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kalev Takkis Subject: Babel, var vrom property drawer in function call? Date: Thu, 3 Sep 2015 20:42:31 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0122a7fcc43c02051edb4e5b Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXYWv-0000s1-OW for emacs-orgmode@gnu.org; Thu, 03 Sep 2015 13:42:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXYWu-00071s-R3 for emacs-orgmode@gnu.org; Thu, 03 Sep 2015 13:42:33 -0400 Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]:32857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXYWu-00071U-NN for emacs-orgmode@gnu.org; Thu, 03 Sep 2015 13:42:32 -0400 Received: by igbkq10 with SMTP id kq10so20305909igb.0 for ; Thu, 03 Sep 2015 10:42:31 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --089e0122a7fcc43c02051edb4e5b Content-Type: text/plain; charset=UTF-8 Hi list, Is there a way to use variables defined as :var: in :PROPERTIES: drawer in function call? Such as ** Some heading :PROPERTIES: :var: par1="smth" :END: #+call: some-function(parameter=par1) Better yet, is there a way to have the function itself to figure out which properties are in effect in a place where a function is called from? What I mean is, when i have a code block #+name: some-function #+begin_src sh :results code echo $par1 #+end_src defined under ** Some heading, evaluating the function will echo the value of par1. But when the function is defined somewhere where par1 is not defined, calling it under ** Some heading with #+call doesn't work. Can I somehow instruct org to automatically use the parameter value from the place where the function is called with #+call, rather than where its body is defined? All the best, Kalev --089e0122a7fcc43c02051edb4e5b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
=
Hi list,

Is there a way to use variables defined as = :var: in :PROPERTIES: drawer in function call? Such as

** Some heading
=C2=A0=C2=A0 :PROPERTIES:<= br>=C2=A0=C2=A0 :var:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 par1=3D"smth"=
=C2=A0=C2=A0 :END:

=C2=A0=C2=A0 #+call: some-function(parameter= =3Dpar1)


Better yet, = is there a way to have the function itself to figure out which properties a= re in effect in a place where a function is called from? What I mean is, wh= en i have a code block

#+name: some-function
#+begin_src sh :resu= lts code
=C2=A0=C2=A0 echo $par1
#+end_src

defined under ** Some heading, evaluating the funct= ion will echo the value of par1. But when the function is defined somewhere= where par1 is not defined, calling it under ** Some heading with #+call do= esn't work. Can I somehow instruct org to automatically use the paramet= er value from the place where the function is called with #+call, rather th= an where its body is defined?

<= span>All the best,
Kalev
<= /span>
--089e0122a7fcc43c02051edb4e5b--