From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: [Exporter] Export of property drawers Date: Fri, 10 May 2013 15:37:48 +0200 Message-ID: References: <87r4hgxfrx.fsf@gmail.com> <87fvxwni3q.fsf@gmail.com> <871u9fnt8o.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UanTb-0007cH-A3 for emacs-orgmode@gnu.org; Fri, 10 May 2013 09:35:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UanTZ-0002tx-TC for emacs-orgmode@gnu.org; Fri, 10 May 2013 09:35:11 -0400 Received: from mail-forward5.uio.no ([2001:700:100:10::37]:58572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UanTZ-0002U6-Ge for emacs-orgmode@gnu.org; Fri, 10 May 2013 09:35:09 -0400 Received: from exim by mail-out5.uio.no with local-bsmtp (Exim 4.80.1) (envelope-from ) id 1UanSx-0003Rt-NV for emacs-orgmode@gnu.org; Fri, 10 May 2013 15:34:31 +0200 In-reply-to: <871u9fnt8o.fsf@gmail.com> 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: Nicolas Goaziou Cc: Alexander Baier , emacs-orgmode@gnu.org, Christian Moe Thanks, Nicolas, That's very useful to know. And although "d:t" was a lot simpler, I understand the point that people will want to customize how they want to export their databases anyway. Your information below is enough to get me started and may save me days of work. Yours, Christian Nicolas Goaziou writes: > Through macros, you can already access to specific properties, e.g.: > > {{{property(ARCHIVE)}}} > > There is no function to dump the whole database in the export buffer > because it contains many Org-specific entries which are irrelevant and > because there are many ways to dump it. > > That's not what you asked, but the following function: > > #+begin_emacs-lisp > (defun my-database-dump (backend) > (goto-char (point-min)) > (while (re-search-forward "^[ \t]*:PROPERTIES" nil t) > (let ((element (org-element-at-point))) > (when (eq (org-element-type element) 'property-drawer) > (goto-char (org-element-property :end element)) > (insert "#+BEGIN_EXAMPLE\n" > (buffer-substring (org-element-property :begin element) > (progn (goto-char > (org-element-property :end element)) > (skip-chars-backward " \r\t\n") > (forward-line) > (point))) > "#+END_EXAMPLE\n"))))) > #+end_emacs-lisp > > when added to `org-export-before-parsing-hook', will wrap every property > drawer within an example block so it can appear in the export output. > > > Regards,