emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "D. C. Toedt" <dc@toedt.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Get :PROPERTY: value from drawer in other heading during HTML export?
Date: Fri, 12 Sep 2014 21:06:32 +0200	[thread overview]
Message-ID: <87tx4cpsjr.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAGN11+1RmHzEZYiEuOjkrzHzFk05YEcdUTg92D1c=HNucTtNjw@mail.gmail.com> (D. C. Toedt's message of "Fri, 12 Sep 2014 09:54:11 -0500")

Hello,

"D. C. Toedt" <dc@toedt.com> writes:

> When generating an HTML file from an org-mode document, I'd like to do a
> GET operation to retrieve a property value from the drawer of an arbitrary
> heading, using the CUSTOM_ID property to identify the heading.  From
> Google-searching, I suspect that "org-heading-components" will be involved,
> but I'm not proficient enough in elisp to be able to figure out how to use
> it from the on-line examples I've found --- and I'm not proficient enough
> in Emacs to use any built-in documentation about it ("apropos" doesn't
> produce any results).
>

[...]

> #+MACRO: get-title [omitted -- thanks to Nicolas Goaziou for the get-title
> macro, at
>
> https://lists.gnu.org/archive/html/emacs-orgmode/2014-02/msg00386.html]

You can use the same macro, replacing

  (org-get-heading nil nil) 

with

  (org-entry-get (point) "$2")

IOW,

  #+MACRO: GET-PROP (eval (or (save-excursion (ignore-errors (let ((org-link-search-inhibit-query t)) (org-open-link-from-string "[[#$1]]") (org-entry-get (point) "$2")))) "UNKNOWN VALUE"))


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2014-09-12 19:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 14:54 Get :PROPERTY: value from drawer in other heading during HTML export? D. C. Toedt
2014-09-12 19:06 ` Nicolas Goaziou [this message]
2014-09-12 19:37   ` D. C. Toedt

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=87tx4cpsjr.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=dc@toedt.com \
    --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).