From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: [patch] fix backend error for html export (was Re: [O] [bug] error in html export: backend not defined) Date: Wed, 02 Mar 2011 08:27:17 +0000 Message-ID: <871v2qvsey.fsf_-_@pinto.chemeng.ucl.ac.uk> References: <8762s2y4fb.fsf@ucl.ac.uk> <11944.1299015550@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=55743 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuhP1-0002Mt-FE for emacs-orgmode@gnu.org; Wed, 02 Mar 2011 03:27:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuhP0-0001r1-8H for emacs-orgmode@gnu.org; Wed, 02 Mar 2011 03:27:23 -0500 Received: from vscani-b2.ucl.ac.uk ([144.82.108.135]:35208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuhP0-0001qf-2n for emacs-orgmode@gnu.org; Wed, 02 Mar 2011 03:27:22 -0500 In-Reply-To: <11944.1299015550@alphaville.dokosmarshall.org> (Nick Dokos's message of "Tue, 01 Mar 2011 16:39:10 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: Emacs Org mode mailing list --=-=-= Content-Type: text/plain Nick Dokos writes: > Eric S Fraga wrote: > >> Hi, >> >> I notice that there has been a recent commit which affects export of org >> files. I have just needed to export an org file to HTML and get the >> following error: >> >> : if: Symbol's value as variable is void: backend >> >> The backtrace is: >> >> ,---- >> | Debugger entered--Lisp error: (void-variable backend) >> | (eq backend (quote html)) >> | (if (eq backend (quote html)) (progn (org-exp-bibtex-docites [...] >> | (when (eq backend (quote html)) (org-exp-bibtex-docites [...] >> | (save-window-excursion (setq oebp-cite-plist [...] >> | org-export-bibtex-preprocess() >> | run-hooks(org-export-preprocess-hook) >> | org-export-preprocess-string( [...] ) >> | org-export-as-html(nil) >> | call-interactively(org-export-as-html) >> | org-export(nil) >> | call-interactively(org-export nil nil) >> `---- >> >> For now, I am going to disable the invocation of the bibtex >> preprocessing as this appears to be the only place that =backend= >> appears. >> > > It's likely that the only thing needed is to rename backend to > org-export-current-backend in contrib/lisp/org-exp-bibtex.el. > See commit 99675ffead44e32f4959909a657b88831fe33703. > > Nick Bastien et al., A patch that seems to fix the problem is attached. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=backend.patch Content-Description: patch to fix backend undefined variable in html export diff --git a/contrib/lisp/org-exp-bibtex.el b/contrib/lisp/org-exp-bibtex.el index de3d662..9d2569f 100644 --- a/contrib/lisp/org-exp-bibtex.el +++ b/contrib/lisp/org-exp-bibtex.el @@ -72,7 +72,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 +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")))) - ((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 +130,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)))))) --=-=-= Content-Type: text/plain -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.4 (release_7.4.576.g99675.dirty) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--