From mboxrd@z Thu Jan 1 00:00:00 1970 From: Edward DeMeulle Subject: Re: Export of property key:value Date: Mon, 29 Jul 2013 20:11:39 -0700 Message-ID: <87bo5k213o.fsf@demeulle.org> References: <87ppujgh3v.fsf@demeulle.org> <87mwpnypdn.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V40Lv-0006mr-FL for emacs-orgmode@gnu.org; Mon, 29 Jul 2013 23:12:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V40Ln-0001AH-9D for emacs-orgmode@gnu.org; Mon, 29 Jul 2013 23:11:59 -0400 Received: from plane.gmane.org ([80.91.229.3]:54032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V40Ln-0001A7-2p for emacs-orgmode@gnu.org; Mon, 29 Jul 2013 23:11:51 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V40Lm-0005CF-2S for emacs-orgmode@gnu.org; Tue, 30 Jul 2013 05:11:50 +0200 Received: from pool-71-119-32-205.lsanca.fios.verizon.net ([71.119.32.205]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Jul 2013 05:11:50 +0200 Received: from ed by pool-71-119-32-205.lsanca.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Jul 2013 05:11:50 +0200 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: emacs-orgmode@gnu.org Nicolas Goaziou writes: > You can use a hook (e.g., `org-export-before-processing-hook) to insert > "amount : {{{property(amount)}}}" (or with `org-entry-get', you don't > need the macro in that case) after each property drawer with an amount > property. (apologies if this is a double-post, the first didn't seem to have been sent) Thanks for the info. I took it up as a challenge to finally learn a little elisp. This is what I have so far, which appears to work as long as I expand the entire subtree to be exported. I'd appreciate any criticism since I really don't know if I'm handling things the best possible way. (defun ewd/export-properties (backend) "Export all properties whose names listed in EXPORT_PROPERTIES in the format: - : after each heading of specified level NOTE: 1st value in EXPORT_PROPERTIES is heading level" (if (org-entry-get (point) "EXPORT_PROPERTIES") (let* ( (export_properties (split-string (org-entry-get (point) "EXPORT_PROPERTIES") " ")) (export-level (string-to-number (car export_properties))) (export-list (cdr export_properties)) ) (org-map-entries (lambda () (next-line) (open-line 1) (dolist (prop export-list) (if (= export-level (car (org-heading-components))) (progn (insert "- " prop ": " (if (org-entry-get (point) prop) (org-entry-get (point) prop) "N/A")) (newline))))))))) (add-hook 'org-export-before-processing-hook 'ewd/export-properties)