From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joon Ro Subject: Re: Using property values in source code blocks Date: Wed, 6 Jul 2016 15:03:34 -0500 Message-ID: References: , Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_89907497-182e-4e56-9c99-fff4138d9902_" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKtMD-0002Oi-U5 for emacs-orgmode@gnu.org; Wed, 06 Jul 2016 16:23:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKtMA-0004Fo-NL for emacs-orgmode@gnu.org; Wed, 06 Jul 2016 16:23:41 -0400 Received: from col004-omc3s14.hotmail.com ([65.55.34.152]:58178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKtMA-0004FQ-Dt for emacs-orgmode@gnu.org; Wed, 06 Jul 2016 16:23:38 -0400 In-Reply-To: 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" To: "Charles C. Berry" Cc: "emacs-orgmode@gnu.org" --_89907497-182e-4e56-9c99-fff4138d9902_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > Yes. `org-property-values' does the trick >=20 >=20 > * Subtree > :PROPERTIES: > :DUMMY: Value > :END: >=20 > #+BEGIN_SRC shell :var dumdum=3D(car (org-property-values "DUMMY")) > echo $dumdum > #+END_SRC >=20 > #+RESULTS: > : Value >=20 > #+NAME: get-property > #+BEGIN_SRC emacs-lisp :var prop=3D"prop" > (org-property-values prop) > #+END_SRC >=20 > #+BEGIN_SRC emacs-lisp :noweb yes > (quote > <> > ) > #+END_SRC >=20 > #+RESULTS: > | Value | >=20 > HTH=2C >=20 > Chuck >=20 Thank you so much for the reply - this would be very useful. Would there be= =2C however=2C a way to directly replace some place holder inside a source = code block? The reason is I have to put those values inside a comment=2C so= I cannot pass them as variables. Best=2CJoon = --_89907497-182e-4e56-9c99-fff4138d9902_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

>=3B Ye= s. `org-property-values' does the trick
>=3B
>=3B
>=3B * S= ubtree
>=3B :PROPERTIES:
>=3B :DUMMY: Value
>=3B :END:
&g= t=3B
>=3B #+BEGIN_SRC shell :var dumdum=3D(car (org-property-values "= DUMMY"))
>=3B echo $dumdum
>=3B #+END_SRC
>=3B
>=3B #+= RESULTS:
>=3B : Value
>=3B
>=3B #+NAME: get-property
>= =3B #+BEGIN_SRC emacs-lisp :var prop=3D"prop"
>=3B (org-property-value= s prop)
>=3B #+END_SRC
>=3B
>=3B #+BEGIN_SRC emacs-lisp :no= web yes
>=3B (quote
>=3B <=3B<=3Bget-property(prop=3D"DUMMY")= >=3B>=3B
>=3B )
>=3B #+END_SRC
>=3B
>=3B #+RESULTS= :
>=3B | Value |
>=3B
>=3B HTH=2C
>=3B
>=3B Chuc= k
>=3B

Thank you so much for the reply -= this would be very useful. Would there be=2C however=2C a way to directly = replace some place holder inside a source code block? The reason is I have = to put those values inside a comment=2C so I cannot pass them as variables.=

Best=2C
Joon
= --_89907497-182e-4e56-9c99-fff4138d9902_--