summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2014-08-08 10:29:59 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2014-08-08 10:29:59 +0200
commitc7a2024f65f36b4805ed9c69906c0b6614774607 (patch)
tree42189b8a297e5ad7b1df49e9afcc70899342295a
parent59cd25cd759cc08fea25ad7796f904fffe2040d7 (diff)
downloadorg-mode-c7a2024f65f36b4805ed9c69906c0b6614774607.tar.gz
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
-rw-r--r--lisp/ox-org.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/ox-org.el b/lisp/ox-org.el
index ae9783b..9ccbbf3 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)))