From c7a2024f65f36b4805ed9c69906c0b6614774607 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 8 Aug 2014 10:29:59 +0200 Subject: [PATCH] ox-org: OPTIONS keyword belong to the template * lisp/ox-org.el (org-org-keyword): Do not handle OPTIONS keywords since those are handled in the template. (org-org-template): Handle OPTIONS keyword. As a consequence, OPTIONS keyword do not appear anymore when doing a body-only export. Thanks to Thorsten Jolitz for suggesting the idea. http://permalink.gmane.org/gmane.emacs.orgmode/89633 --- lisp/ox-org.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ox-org.el b/lisp/ox-org.el index ae9783bce..9ccbbf3aa 100644 --- a/lisp/ox-org.el +++ b/lisp/ox-org.el @@ -147,7 +147,7 @@ keywords targeted at other export back-ends." org-element-block-name-alist)) (member key '("AUTHOR" "CREATOR" "DATE" "DESCRIPTION" "EMAIL" - "KEYWORDS" "TITLE"))) + "KEYWORDS" "OPTIONS" "TITLE"))) (org-element-keyword-interpreter keyword nil)))) (defun org-org-template (contents info) @@ -157,6 +157,14 @@ as a communication channel." (concat (and (plist-get info :time-stamp-file) (format-time-string "# Created %Y-%m-%d %a %H:%M\n")) + (org-element-normalize-string + (mapconcat #'identity + (org-element-map (plist-get info :parse-tree) 'keyword + (lambda (k) + (and (string-equal (org-element-property :key k) "OPTIONS") + (concat "#+OPTIONS: " + (org-element-property :value k))))) + "\n")) (format "#+TITLE: %s\n" (org-export-data (plist-get info :title) info)) (and (plist-get info :with-date) (let ((date (org-export-data (org-export-get-date info) info))) -- 2.11.4.GIT