From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [Exporter] Export of property drawers Date: Fri, 10 May 2013 10:17:59 +0200 Message-ID: <871u9fnt8o.fsf@gmail.com> References: <87r4hgxfrx.fsf@gmail.com> <87fvxwni3q.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaiWg-0007oN-9X for emacs-orgmode@gnu.org; Fri, 10 May 2013 04:18:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UaiWf-0001Ri-1Q for emacs-orgmode@gnu.org; Fri, 10 May 2013 04:18:02 -0400 Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]:60845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaiWe-0001Rd-Qk for emacs-orgmode@gnu.org; Fri, 10 May 2013 04:18:00 -0400 Received: by mail-wg0-f50.google.com with SMTP id m15so3880611wgh.5 for ; Fri, 10 May 2013 01:18:00 -0700 (PDT) In-Reply-To: (Christian Moe's message of "Thu, 09 May 2013 22:01:24 +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: Christian Moe Cc: Alexander Baier , emacs-orgmode@gnu.org Hello, Christian Moe writes: > Nicolas, do I understand correctly that the contents of a property > drawer will not export? Correct > Back before I switched to the new exporter, all > I had to do to export properties was to add > > #+OPTIONS: d:t > > but I notice this doesn't work, nor does d:(PROPERTIES). No, it won't. See docstring for `org-export-with-drawers'. Property drawers are very different from regular drawers. > Properties are sometimes used to make simple databases of useful > stuff. (I compiled a bunch of research notes like that just before > before switching to the new exporter!) It would be nice to have an easy > way to print them without having to figure out how to do it with filters > or defadvices. 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, -- Nicolas Goaziou