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.
This commit is contained in:
parent
41bf22f4dc
commit
4db8048a23
|
@ -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))
|
||||
|
||||
|
|
|
@ -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."
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue