diff options
author | Jambunathan K <kjambunathan@gmail.com> | 2011-08-02 14:51:09 +0530 |
---|---|---|
committer | Jambunathan K <kjambunathan@gmail.com> | 2011-08-02 15:00:15 +0530 |
commit | 4db8048a23415a8f454badba0b2b1f1a938c5500 (patch) | |
tree | d4a2b68f9a6b1f664703961cccf0e89bd9b68749 | |
parent | 41bf22f4dc18b217e3c54b777ed3169978bdc877 (diff) | |
download | org-mode-4db8048a23415a8f454badba0b2b1f1a938c5500.tar.gz |
Introduce org-lparse-unregister-backend and use it
* contrib/lisp/org-lparse.el (org-lparse-unregister-backend):
New.
* contrib/lisp/org-odt.el (org-odt-unload-function):
New. De-register from org-lparse on unload.
* contrib/lisp/org-xhtml.el (org-xhtml-unload-function):
New. De-register from org-lparse on unload.
-rwxr-xr-x | contrib/lisp/org-lparse.el | 8 | ||||
-rw-r--r-- | contrib/lisp/org-odt.el | 5 | ||||
-rw-r--r-- | contrib/lisp/org-xhtml.el | 5 |
3 files changed, 18 insertions, 0 deletions
diff --git a/contrib/lisp/org-lparse.el b/contrib/lisp/org-lparse.el index c96ec84..71a7a2b 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 fbbf638..efa777b 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 f3d8079..e491c78 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)) |