From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joon Ro Subject: Re: Using property values in source code blocks Date: Fri, 15 Jul 2016 18:38:36 -0500 Message-ID: References: ,,, , , ,,, , , , , , , , Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_fcdbe08b-8a91-49f6-95b5-a96eca069f8d_" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOCgu-00050x-06 for emacs-orgmode@gnu.org; Fri, 15 Jul 2016 19:38:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOCgp-0006rG-1U for emacs-orgmode@gnu.org; Fri, 15 Jul 2016 19:38:42 -0400 Received: from col004-omc3s18.hotmail.com ([65.55.34.157]:60895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOCgo-0006r2-P1 for emacs-orgmode@gnu.org; Fri, 15 Jul 2016 19:38: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" --_fcdbe08b-8a91-49f6-95b5-a96eca069f8d_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > --8<---------------cut here---------------end--------------->8--- >=20 > * Subtree > :PROPERTIES: > :DUMMY: Value > :END: >=20 > #+NAME: get-property > #+BEGIN_SRC emacs-lisp :var prop=3D"prop" > (car (org-property-values prop)) > #+END_SRC >=20 > #+BEGIN_SRC shell :noweb yes >=20 > echo <> >=20 > #+END_SRC >=20 > #+RESULTS: > : Value >=20 > --8<---------------cut here---------------end--------------->8--- >=20 It seems org-property-values gets the property value for the buffer - it en= ds up getting the property value from the last subtree in the buffer. I sol= ved this by using either (org-entry-get nil prop) or (car (org-entry-get-mu= ltivalued-property nil prop)) instead of (car (org-property-values prop)).= =20 Thanks again!-Joon = --_fcdbe08b-8a91-49f6-95b5-a96eca069f8d_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
>= =3B --8<=3B---------------cut here---------------end--------------->=3B= 8---
>=3B
>=3B * Subtree
>=3B :PROPERTIES:
>=3B :DUMMY= : Value
>=3B :END:
>=3B
>=3B #+NAME: get-property
>=3B= #+BEGIN_SRC emacs-lisp :var prop=3D"prop"
>=3B (car (org-property-val= ues prop))
>=3B #+END_SRC
>=3B
>=3B #+BEGIN_SRC shell :nowe= b yes
>=3B
>=3B echo <=3B<=3Bget-property(prop=3D"DUMMY")>= =3B>=3B
>=3B
>=3B #+END_SRC
>=3B
>=3B #+RESULTS:>=3B : Value
>=3B
>=3B --8<=3B---------------cut here------= ---------end--------------->=3B8---
>=3B

It seems=  =3Borg-property-values gets the pro= perty value for the buffer - it ends up getting the property value from the= last subtree in the buffer. =3BI solved this by using either =3B(org-entry-get nil prop) or =3B(car (org-entry-get-multivalued-property nil prop)) instead of&n= bsp=3B(car (org-property-values p= rop)). =3B

Thanks again!
=
-Joon

= --_fcdbe08b-8a91-49f6-95b5-a96eca069f8d_--