summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-03-02 18:15:09 +0100
committerBastien Guerry <bzg@altern.org>2011-03-02 18:15:09 +0100
commite7409b5cd105c33b3053e4ee8fcb6b9d5f724ecb (patch)
tree02f4bdeff9f125c4df366453b57e305561da8bc3
parent99675ffead44e32f4959909a657b88831fe33703 (diff)
downloadorg-mode-e7409b5cd105c33b3053e4ee8fcb6b9d5f724ecb.tar.gz
org-exp-bibtex.el: Use `org-export-bibtex-preprocess'.
* org-exp-bibtex.el (org-export-bibtex-preprocess): Use `org-export-current-backend'.
-rw-r--r--contrib/lisp/org-exp-bibtex.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/lisp/org-exp-bibtex.el b/contrib/lisp/org-exp-bibtex.el
index de3d662..63f71ef 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 "<hr>" nil t)
(replace-match "<hr/>" t t))
(concat "\n#+BEGIN_HTML\n<div id=\"bibliography\">\n" (buffer-string) "\n</div>\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))))))