emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: nicholas.dokos@hp.com
Cc: Emacs Org mode mailing list <emacs-orgmode@gnu.org>
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	[thread overview]
Message-ID: <871v2qvsey.fsf_-_@pinto.chemeng.ucl.ac.uk> (raw)
In-Reply-To: <11944.1299015550@alphaville.dokosmarshall.org> (Nick Dokos's message of "Tue, 01 Mar 2011 16:39:10 -0500")

[-- Attachment #1: Type: text/plain, Size: 1355 bytes --]

Nick Dokos <nicholas.dokos@hp.com> writes:

> Eric S Fraga <e.fraga@ucl.ac.uk> 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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch to fix backend undefined variable in html export --]
[-- Type: text/x-diff, Size: 1430 bytes --]

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 "<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 +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))))))

[-- Attachment #3: Type: text/plain, Size: 127 bytes --]


-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.4 (release_7.4.576.g99675.dirty)

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

  parent reply	other threads:[~2011-03-02  8:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 20:24 [bug] error in html export: backend not defined Eric S Fraga
2011-03-01 21:39 ` Nick Dokos
2011-03-02  7:00   ` Eric S Fraga
2011-03-02  8:27   ` Eric S Fraga [this message]
2011-03-02 17:17     ` [patch] fix backend error for html export (was Re: [O] [bug] error in html export: backend not defined) Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871v2qvsey.fsf_-_@pinto.chemeng.ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=nicholas.dokos@hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).