From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Joon Ro <joon.ro@outlook.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Using property values in source code blocks
Date: Fri, 15 Jul 2016 19:05:52 -0700 [thread overview]
Message-ID: <alpine.OSX.2.20.1607151848260.575@charles-berrys-macbook.local> (raw)
In-Reply-To: <COL125-W34559D9AC3F1C4BEC30822EB330@phx.gbl>
On Fri, 15 Jul 2016, Joon Ro wrote:
>
> 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?
Give org-entry-get a suitable value for `pom'.
See the docstring for org-entry-get.
Example:
--8<---------------cut here---------------start------------->8---
* Top Heading
#+NAME: get-property
#+BEGIN_SRC emacs-lisp :noweb yes :var prop="prop" :var pom=0
(car (org-entry-get-multivalued-property pom prop))
#+END_SRC
** Subheading
:PROPERTIES:
:DUMMY: 100
:END:
#+BEGIN_SRC shell :noweb yes
echo <<get-property(prop="DUMMY",pom=(point))>>
#+END_SRC
#+RESULTS:
: 100
--8<---------------cut here---------------end--------------->8---
Chuck
next prev parent reply other threads:[~2016-07-16 2:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-06 4:10 Using property values in source code blocks Joon Ro
2016-07-06 17:36 ` Charles C. Berry
2016-07-06 20:03 ` Joon Ro
2016-07-06 23:05 ` Charles C. Berry
2016-07-07 3:50 ` Joon Ro
2016-07-07 15:48 ` Charles C. Berry
2016-07-07 15:53 ` Joon Ro
2016-07-15 23:38 ` Joon Ro
2016-07-15 23:44 ` Joon Ro
2016-07-16 2:05 ` Charles C. Berry [this message]
2016-07-16 2:47 ` Joon Ro
2016-07-16 16:02 ` Charles C. Berry
2016-07-16 17:00 ` Joon Ro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.OSX.2.20.1607151848260.575@charles-berrys-macbook.local \
--to=ccberry@ucsd.edu \
--cc=emacs-orgmode@gnu.org \
--cc=joon.ro@outlook.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.