diff --git a/contrib/lisp/org-lparse.el b/contrib/lisp/org-lparse.el index 105c977cd..29785b0f5 100755 --- a/contrib/lisp/org-lparse.el +++ b/contrib/lisp/org-lparse.el @@ -337,9 +337,11 @@ OPT-PLIST is the export options list." (when org-lparse-do-open-par (org-lparse-begin-paragraph)))) -(defvar org-lparse-native-backends - '("xhtml" "odt") +(defvar org-lparse-native-backends nil "List of native backends registered with `org-lparse'. +A backend can use `org-lparse-register-backend' to add itself to +this list. + All native backends must implement a get routine and a mandatory set of callback routines. @@ -354,6 +356,16 @@ For the sake of illustration, the html backend implements `org-xhtml-entity-format-callbacks-alist' as the values of ENTITY-CONTROL and ENTITY-FORMAT settings.") +(defun org-lparse-register-backend (backend) + "Make BACKEND known to org-lparse library. +Add BACKEND to `org-lparse-native-backends'." + (when backend + (setq backend (cond + ((symbolp backend) (symbol-name backend)) + ((stringp backend) backend) + (t (error "Error while registering backend: %S" backend)))) + (add-to-list 'org-lparse-native-backends backend))) + (defun org-lparse-get-other-backends (native-backend) (org-lparse-backend-get native-backend 'OTHER-BACKENDS)) diff --git a/contrib/lisp/org-odt.el b/contrib/lisp/org-odt.el index cd9779811..f3a406761 100644 --- a/contrib/lisp/org-odt.el +++ b/contrib/lisp/org-odt.el @@ -128,9 +128,12 @@ (cons (concat "\\." (car desc) "\\'") 'system))) org-odt-ms-file-extensions) -;; register the odt exporter +;; register the odt exporter with the pre-processor (add-to-list 'org-export-backends 'odt) +;; register the odt exporter with org-lparse library +(org-lparse-register-backend 'odt) + (defcustom org-export-odt-automatic-styles-file nil "Default style file for use with ODT exporter." :type 'file diff --git a/contrib/lisp/org-xhtml.el b/contrib/lisp/org-xhtml.el index d6c1c27d4..f4b47c952 100644 --- a/contrib/lisp/org-xhtml.el +++ b/contrib/lisp/org-xhtml.el @@ -1194,6 +1194,9 @@ make any modifications to the exporter file. For example, `org-xhtml-format-table-row' encloses incoming entity in tags and returns it. See also `org-lparse-format'.") +;; register the xhtml exporter with org-lparse library +(org-lparse-register-backend 'xhtml) + (defun org-xhtml-begin-document-body (opt-plist) (let ((link-up (and (plist-get opt-plist :link-up) (string-match "\\S-" (plist-get opt-plist :link-up)) @@ -1652,7 +1655,7 @@ lang=\"%s\" xml:lang=\"%s\"> (SAVE-METHOD nil) (CLEANUP-METHOD nil) (OTHER-BACKENDS - '("etext" "html" "html10" "mediawiki" "pdf" "sdw" "sdw3" "sdw4" + '("xhtml" "etext" "html" "html10" "mediawiki" "pdf" "sdw" "sdw3" "sdw4" "text" "text10" "odt" "vor" "vor4")) (CONVERT-METHOD org-lparse-convert-process) (EXPORT-DIR (org-export-directory :html opt-plist))