From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Get :PROPERTY: value from drawer in other heading during HTML export? Date: Fri, 12 Sep 2014 21:06:32 +0200 Message-ID: <87tx4cpsjr.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSWAN-0006BB-Of for emacs-orgmode@gnu.org; Fri, 12 Sep 2014 15:06:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSWAH-0004yE-5L for emacs-orgmode@gnu.org; Fri, 12 Sep 2014 15:05:55 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:59268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSWAG-0004y8-Vy for emacs-orgmode@gnu.org; Fri, 12 Sep 2014 15:05:49 -0400 In-Reply-To: (D. C. Toedt's message of "Fri, 12 Sep 2014 09:54:11 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "D. C. Toedt" Cc: emacs-orgmode@gnu.org Hello, "D. C. Toedt" 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