emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Using property values in source code blocks


From: Joon Ro
Subject: Re: [O] Using property values in source code blocks
Date: Fri, 15 Jul 2016 18:44:42 -0500


It seems org-property-values gets the property value for the buffer - it ends up getting the property value from the last subtree in the buffer. I solved this by using either (org-entry-get nil prop) or (car (org-entry-get-multivalued-property nil prop)) instead of (car (org-property-values prop)). 

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

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

** Subheading
:PROPERTIES:
:DUMMY:    100
:END:

#+BEGIN_SRC shell :noweb yes
echo <<get-property(prop="DUMMY")>>
#+END_SRC

yields nil. 

Best Regards,
Joon


reply via email to

[Prev in Thread] Current Thread [Next in Thread]