emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Joon Ro <joon.ro@outlook.com>
To: "Charles C. Berry" <ccberry@ucsd.edu>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Using property values in source code blocks
Date: Fri, 15 Jul 2016 18:38:36 -0500	[thread overview]
Message-ID: <COL125-W167D06CDABFD7D2844F7E0EB330@phx.gbl> (raw)
In-Reply-To: <COL125-W52277CAE70F9C1CB25EFCDEB3B0@phx.gbl>

[-- Attachment #1: Type: text/plain, Size: 798 bytes --]

> --8<---------------cut here---------------end--------------->8---
> 
> * Subtree
> :PROPERTIES:
> :DUMMY: Value
> :END:
> 
> #+NAME: get-property
> #+BEGIN_SRC emacs-lisp :var prop="prop"
> (car (org-property-values prop))
> #+END_SRC
> 
> #+BEGIN_SRC shell :noweb yes
> 
> echo <<get-property(prop="DUMMY")>>
> 
> #+END_SRC
> 
> #+RESULTS:
> : Value
> 
> --8<---------------cut here---------------end--------------->8---
> 

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)). 
Thanks again!-Joon
 		 	   		   		 	   		  

[-- Attachment #2: Type: text/html, Size: 1711 bytes --]

  reply	other threads:[~2016-07-15 23:38 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 [this message]
2016-07-15 23:44               ` Joon Ro
2016-07-16  2:05                 ` Charles C. Berry
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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=COL125-W167D06CDABFD7D2844F7E0EB330@phx.gbl \
    --to=joon.ro@outlook.com \
    --cc=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).