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:44:42 -0500 Message-ID: References: ,,, , , , , , , , , , , , , , , , , Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_f6a22699-b6f9-45b7-b83e-2cfa26d89800_" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOCmm-0004m6-RL for emacs-orgmode@gnu.org; Fri, 15 Jul 2016 19:44:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOCmh-0007ny-Tt for emacs-orgmode@gnu.org; Fri, 15 Jul 2016 19:44:47 -0400 Received: from col004-omc3s7.hotmail.com ([65.55.34.145]:56231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOCmh-0007ns-K7 for emacs-orgmode@gnu.org; Fri, 15 Jul 2016 19:44:43 -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" --_f6a22699-b6f9-45b7-b83e-2cfa26d89800_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 I spoke too early - with (org-entry-get nil prop) I have to put the code bl= ock under the subtree I want to extract the property value from. Would it b= e possible to get the property value of the current subtree? For example=2C= the following * Top Heading#+NAME: get-property#+BEGIN_SRC emacs-lisp :noweb yes :var pro= p=3D"prop"(car (org-entry-get-multivalued-property nil prop))#+END_SRC ** Subheading:PROPERTIES::DUMMY: 100:END: #+BEGIN_SRC shell :noweb yesecho <>#+END_SRC yields nil.=20 Best Regards=2CJoon = --_f6a22699-b6f9-45b7-b83e-2cfa26d89800_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

<= div>
It seems =3Borg-property-values gets the property value for the buffer - it ends up ge= tting 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-prop= erty nil prop)) instead of =3B= (car (org-property-values prop)). =3B

I spoke too early - with =3B(org-entry-get nil prop) I have to put the code block under the subtre= e I want to extract the property value from. Would it be possible to get th= e property value of the current subtree? For example=2C the following

* Top Heading
<= div>
#+NAME: get-property
#+BEGIN_SRC emacs-lisp :noweb yes :var prop=3D"prop"
=
(car (org-entry-get-multivalued-property nil prop))
<= /div>
#+END_SRC

** Subheading
:PROPERTIES= :
:= DUMMY:  =3B  =3B100
:END:

=
#+BEGIN_SRC she= ll :noweb yes
echo <=3B<=3Bget-property(prop=3D"DUMMY")&g= t=3B>=3B
#+END_SRC
=

yields nil. =3B

Best Rega= rds=2C
Joon

= --_f6a22699-b6f9-45b7-b83e-2cfa26d89800_--