diff --git a/lisp/org-exp.el b/lisp/org-exp.el index ae18ad3..bf94899 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -893,6 +893,8 @@ value of `org-export-run-in-background'." \[D] export as DocBook [V] export as DocBook, process to PDF, and open +\[o] export as ODT [O] export as ODT and open + \[j] export as TaskJuggler [J] ... and open \[m] export as Freemind mind map @@ -921,6 +923,8 @@ value of `org-export-run-in-background'." (?g org-export-generic t) (?D org-export-as-docbook t) (?V org-export-as-docbook-pdf-and-open t) + (?o org-export-as-odt t) + (?O org-export-as-odt-and-open nil) (?j org-export-as-taskjuggler t) (?J org-export-as-taskjuggler-and-open t) (?m org-export-as-freemind t) @@ -1020,10 +1024,12 @@ on this string to produce the exported version." (asciip (plist-get parameters :for-ascii)) (latexp (plist-get parameters :for-LaTeX)) (docbookp (plist-get parameters :for-docbook)) + (odtp (plist-get parameters :for-odt)) (backend (cond (htmlp 'html) (latexp 'latex) (asciip 'ascii) - (docbookp 'docbook))) + (docbookp 'docbook) + (odtp 'odt))) (archived-trees (plist-get parameters :archived-trees)) (inhibit-read-only t) (drawers org-drawers) @@ -1193,6 +1199,12 @@ on this string to produce the exported version." (require 'org-docbook nil) (org-export-docbook-preprocess parameters)) + ;; ODT-specific preprocessing + ;; Table References are inserted here + (when odtp + (require 'org-odt nil) + (org-export-odt-preprocess parameters)) + ;; Remove or replace comments (org-export-handle-comments (plist-get parameters :comments)) @@ -1650,7 +1662,7 @@ These special cookies will later be interpreted by the backend. ((memq backend '(latex)) nil) ;; 2. Line-processing backends need to be told where lists end. - ((memq backend '(html docbook)) + ((memq backend '(html docbook odt)) (funcall process-buffer "ORG-LIST-END\n")) ;; 3. Others backends do not need to know this: clean list enders. (t @@ -2292,6 +2304,22 @@ INDENT was the original indentation of the block." "]]>\n") '(org-protected t org-example t)) "#+END_DOCBOOK\n")) + + ;; FIXME: backend should really be odt. Use html for + ;; now. The test short-circuits html specific processing + ;; that happens later. Not sure whether we need any of it + ;; later. + + ((eq backend 'odt) + (setq rtn (org-export-number-lines + rtn 'docbook 0 0 num cont rpllbl fmt)) + (concat "\n#+BEGIN_ODT\n" + (org-add-props + (concat + "" + rtn "\n") '(org-protected t org-example t)) + "#+END_ODT\n")) + ((eq backend 'html) ;; We are exporting to HTML (when lang