From 68114fb650f4653eb6e71f3004e396c4241e54dd Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 18 Feb 2011 09:49:12 +0100 Subject: [PATCH] Replace remaining htmlp and latexp conditions. --- contrib/lisp/org-exp-bibtex.el | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/contrib/lisp/org-exp-bibtex.el b/contrib/lisp/org-exp-bibtex.el index ab6a6b006..de3d662e3 100644 --- a/contrib/lisp/org-exp-bibtex.el +++ b/contrib/lisp/org-exp-bibtex.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2009 Taru Karttunen -;; Author: Taru Karttunen +;; Author: Taru Karttunen ;; This file is not currently part of GNU Emacs. @@ -72,13 +72,12 @@ (opt (org-exp-bibtex-options-to-plist (match-string 3)))) (replace-match (cond - (htmlp ;; We are exporting to HTML + ((eq backend 'html) ;; We are exporting to HTML (let (extra-args cite-list end-hook tmp-files) (dolist (elt opt) (when (equal "option" (car elt)) (setq extra-args (cons (cdr elt) extra-args)))) - (when (assoc "limit" opt) ;; Limit is true - collect references (org-exp-bibtex-docites (lambda () (dolist (c (org-split-string (match-string 1) ",")) @@ -107,13 +106,12 @@ (while (re-search-forward "
" nil t) (replace-match "
" t t)) (concat "\n#+BEGIN_HTML\n
\n" (buffer-string) "\n
\n#+END_HTML\n")))) - (latexp ;; Latex export + ((eq backend 'latex) ;; Latex export (concat "\n#+LATEX: \\bibliographystyle{" style "}" "\n#+LATEX: \\bibliography{" file "}\n"))) t t))) - ;; Convert cites to links in html - (when htmlp + (when (eq backend 'html) ;; Split citation commands with multiple keys (org-exp-bibtex-docites (lambda () @@ -126,28 +124,21 @@ (lambda () (let* ((cn (match-string 1)) (cv (assoc cn oebp-cite-plist))) ;; (message "L: %s" (concat "\[_{}[[" cn "][" (if cv (cdr cv) cn) "]]\]")) - (replace-match (concat "\[_{}[[#" cn "][" (if cv (cdr cv) cn) "]]\]")) t t)))) - - -)) + (replace-match (concat "\[_{}[[#" cn "][" (if cv (cdr cv) cn) "]]\]")) t t)))))) (defun org-exp-bibtex-docites (fun) (save-excursion (save-match-data (goto-char (point-min)) - (when htmlp + (when (eq backend 'html) (while (re-search-forward "\\\\cite{\\([^}\n]+\\)}" nil t) (apply fun nil)))))) - (defun org-exp-bibtex-options-to-plist (options) (save-match-data (flet ((f (o) (let ((s (split-string o ":"))) (cons (nth 0 s) (nth 1 s))))) (mapcar 'f (split-string options nil t))))) - - - (add-hook 'org-export-preprocess-hook 'org-export-bibtex-preprocess) (provide 'org-exp-bibtex)