summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2012-08-16 12:46:49 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2012-08-16 12:46:49 +0200
commit952d722dcddb275d84ad6dd356bee2fd5c8027c8 (patch)
tree7e3289d01bd89e473e1b23c9c189abd84e3c40f4
parentd2200b2bede8d596119c97961aefc6e81319234c (diff)
downloadorg-mode-952d722dcddb275d84ad6dd356bee2fd5c8027c8.tar.gz
org-export: Allow to toggle inlinetasks inclusion in export output
* contrib/lisp/org-export.el (org-export-options-alist, org-export--skip-p): Allow to toggle inlinetask inclusion in export. (org-export-headline-levels, org-export-with-priority): Fix docstring. (org-export-with-inlinetasks): New variable. * testing/lisp/test-org-export.el: Add tests.
-rw-r--r--contrib/lisp/org-export.el17
-rw-r--r--testing/lisp/test-org-export.el27
2 files changed, 33 insertions, 11 deletions
diff --git a/contrib/lisp/org-export.el b/contrib/lisp/org-export.el
index c5cbaaa..24dc35b 100644
--- a/contrib/lisp/org-export.el
+++ b/contrib/lisp/org-export.el
@@ -138,6 +138,7 @@
(:with-entities nil "e" org-export-with-entities)
(:with-fixed-width nil ":" org-export-with-fixed-width)
(:with-footnotes nil "f" org-export-with-footnotes)
+ (:with-inlinetasks nil "inline" org-export-with-inlinetasks)
(:with-plannings nil "p" org-export-with-planning)
(:with-priority nil "pri" org-export-with-priority)
(:with-special-strings nil "-" org-export-with-special-strings)
@@ -405,9 +406,7 @@ e.g. \"f:nil\"."
(defcustom org-export-headline-levels 3
"The last level which is still exported as a headline.
-Inferior levels will produce itemize lists when exported. Note
-that a numeric prefix argument to an exporter function overrides
-this setting.
+Inferior levels will produce itemize lists when exported.
This option can also be set with the #+OPTIONS line, e.g. \"H:2\"."
:group 'org-export-general
@@ -444,6 +443,13 @@ e.g. \"e:nil\"."
:group 'org-export-general
:type 'boolean)
+(defcustom org-export-with-inlinetasks t
+ "Non-nil means inlinetasks should be exported.
+This option can also be set with the #+OPTIONS line,
+e.g. \"inline:nil\"."
+ :group 'org-export-general
+ :type 'boolean)
+
(defcustom org-export-with-planning nil
"Non-nil means include planning info in export.
This option can also be set with the #+OPTIONS: line,
@@ -453,9 +459,6 @@ e.g. \"p:t\"."
(defcustom org-export-with-priority nil
"Non-nil means include priority cookies in export.
-
-When nil, remove priority cookies for export.
-
This option can also be set with the #+OPTIONS line,
e.g. \"pri:t\"."
:group 'org-export-general
@@ -1814,6 +1817,8 @@ tag."
(and (memq with-tasks '(todo done))
(not (eq todo-type with-tasks)))
(and (consp with-tasks) (not (member todo with-tasks))))))))
+ ;; Check inlinetask.
+ (inlinetask (not (plist-get options :with-inlinetasks)))
;; Check timestamp.
(timestamp
(case (plist-get options :with-timestamps)
diff --git a/testing/lisp/test-org-export.el b/testing/lisp/test-org-export.el
index 3b372f9..56b351e 100644
--- a/testing/lisp/test-org-export.el
+++ b/testing/lisp/test-org-export.el
@@ -65,14 +65,14 @@ already filled in `info'."
(equal
(org-export--parse-option-keyword
"H:1 num:t \\n:t timestamp:t arch:t author:t creator:t d:t email:t
- *:t e:t ::t f:t pri:t -:t ^:t toc:t |:t tags:t tasks:t <:t todo:t")
+ *:t e:t ::t f:t pri:t -:t ^:t toc:t |:t tags:t tasks:t <:t todo:t inline:nil")
'(:headline-levels
1 :preserve-breaks t :section-numbers t :time-stamp-file t
:with-archived-trees t :with-author t :with-creator t :with-drawers t
:with-email t :with-emphasize t :with-entities t :with-fixed-width t
- :with-footnotes t :with-priority t :with-special-strings t
- :with-sub-superscript t :with-toc t :with-tables t :with-tags t
- :with-tasks t :with-timestamps t :with-todo-keywords t)))
+ :with-footnotes t :with-inlinetasks nil :with-priority t
+ :with-special-strings t :with-sub-superscript t :with-toc t :with-tables t
+ :with-tags t :with-tasks t :with-timestamps t :with-todo-keywords t)))
;; Test some special values.
(should
(equal
@@ -265,7 +265,24 @@ Paragraph"
"CLOSED: [2012-04-29 sun. 10:45]\n"))
(should
(equal (org-export-as 'test nil nil nil '(:with-plannings nil))
- ""))))))
+ "")))))
+ ;; Inlinetasks.
+ (when (featurep 'org-inlinetask)
+ (should
+ (equal
+ (let ((org-inlinetask-min-level 15))
+ (org-test-with-temp-text "*************** Task"
+ (org-test-with-backend test
+ (org-export-as 'test nil nil nil '(:with-inlinetasks nil)))))
+ ""))
+ (should
+ (equal
+ (let ((org-inlinetask-min-level 15))
+ (org-test-with-temp-text
+ "*************** Task\nContents\n*************** END"
+ (org-test-with-backend test
+ (org-export-as 'test nil nil nil '(:with-inlinetasks nil)))))
+ ""))))
(ert-deftest test-org-export/comment-tree ()
"Test if export process ignores commented trees."