diff --git a/contrib/lisp/org-lparse.el b/contrib/lisp/org-lparse.el index c96ec8464..71a7a2b78 100755 --- a/contrib/lisp/org-lparse.el +++ b/contrib/lisp/org-lparse.el @@ -366,6 +366,14 @@ Add BACKEND to `org-lparse-native-backends'." (t (error "Error while registering backend: %S" backend)))) (add-to-list 'org-lparse-native-backends backend))) +(defun org-lparse-unregister-backend (backend) + (setq org-lparse-native-backends + (remove (cond + ((symbolp backend) (symbol-name backend)) + ((stringp backend) backend)) + org-lparse-native-backends)) + (message "Unregistered backend %S" 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 fbbf63853..efa777b51 100644 --- a/contrib/lisp/org-odt.el +++ b/contrib/lisp/org-odt.el @@ -143,6 +143,11 @@ OpenDocument xml files.") ;; register the odt exporter with org-lparse library (org-lparse-register-backend 'odt) +(defun org-odt-unload-function () + ;; notify org-lparse library on unload + (org-lparse-unregister-backend 'odt) + nil) + (defcustom org-export-odt-automatic-styles-file nil "Automatic styles for use with ODT exporter. If unspecified, the file under `org-odt-data-dir' is used." diff --git a/contrib/lisp/org-xhtml.el b/contrib/lisp/org-xhtml.el index f3d8079bb..e491c78ae 100644 --- a/contrib/lisp/org-xhtml.el +++ b/contrib/lisp/org-xhtml.el @@ -1197,6 +1197,11 @@ make any modifications to the exporter file. For example, ;; register the xhtml exporter with org-lparse library (org-lparse-register-backend 'xhtml) +(defun org-xhtml-unload-function () + ;; notify org-lparse library on unload + (org-lparse-unregister-backend 'xhtml) + nil) + (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))