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: Charles C. Berry
Subject: Re: [O] Using property values in source code blocks
Date: Wed, 6 Jul 2016 10:36:55 -0700
User-agent: Alpine 2.20 (OSX 67 2015-01-07)

On Tue, 5 Jul 2016, Joon Ro wrote:

Hi,

I'm aware of passing variables through header arguments, and also inserting another source code block using the noweb syntax.

I was wondering, however, would it be possible to directly input values of properties inside source code blocks? For example,

Yes. `org-property-values' does the trick


* Subtree
:PROPERTIES:
:DUMMY: Value
:END:

#+BEGIN_SRC shell :var dumdum=(car (org-property-values "DUMMY"))
echo $dumdum
#+END_SRC

#+RESULTS:
: Value

#+NAME: get-property
#+BEGIN_SRC emacs-lisp :var prop="prop"
(org-property-values prop)
#+END_SRC

#+BEGIN_SRC emacs-lisp :noweb yes
(quote
<<get-property(prop="DUMMY")>>
)
#+END_SRC

#+RESULTS:
| Value |

HTH,

Chuck



reply via email to

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