From e7409b5cd105c33b3053e4ee8fcb6b9d5f724ecb Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 2 Mar 2011 18:15:09 +0100 Subject: [PATCH] org-exp-bibtex.el: Use `org-export-bibtex-preprocess'. * org-exp-bibtex.el (org-export-bibtex-preprocess): Use `org-export-current-backend'. --- contrib/lisp/org-exp-bibtex.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/contrib/lisp/org-exp-bibtex.el b/contrib/lisp/org-exp-bibtex.el index de3d662e3..63f71ef5d 100644 --- a/contrib/lisp/org-exp-bibtex.el +++ b/contrib/lisp/org-exp-bibtex.el @@ -58,6 +58,8 @@ (require 'org) (require 'org-exp) + +(defvar org-export-current-backend) ; dynamically bound in org-exp.el (defun org-export-bibtex-preprocess () "Export all BibTeX." (interactive) @@ -72,7 +74,7 @@ (opt (org-exp-bibtex-options-to-plist (match-string 3)))) (replace-match (cond - ((eq backend 'html) ;; We are exporting to HTML + ((eq org-export-current-backend 'html) ;; We are exporting to HTML (let (extra-args cite-list end-hook tmp-files) (dolist (elt opt) (when (equal "option" (car elt)) @@ -106,12 +108,12 @@ (while (re-search-forward "
" nil t) (replace-match "
" t t)) (concat "\n#+BEGIN_HTML\n
\n" (buffer-string) "\n
\n#+END_HTML\n")))) - ((eq backend 'latex) ;; Latex export + ((eq org-export-current-backend 'latex) ;; Latex export (concat "\n#+LATEX: \\bibliographystyle{" style "}" "\n#+LATEX: \\bibliography{" file "}\n"))) t t))) ;; Convert cites to links in html - (when (eq backend 'html) + (when (eq org-export-current-backend 'html) ;; Split citation commands with multiple keys (org-exp-bibtex-docites (lambda () @@ -130,7 +132,7 @@ (save-excursion (save-match-data (goto-char (point-min)) - (when (eq backend 'html) + (when (eq org-export-current-backend 'html) (while (re-search-forward "\\\\cite{\\([^}\n]+\\)}" nil t) (apply fun nil))))))