emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug] error in html export: backend not defined
@ 2011-03-01 20:24 Eric S Fraga
  2011-03-01 21:39 ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2011-03-01 20:24 UTC (permalink / raw)
  To: Emacs Org mode mailing list

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.

thanks,
eric

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [bug] error in html export: backend not defined
  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   ` [patch] fix backend error for html export (was Re: [O] [bug] error in html export: backend not defined) Eric S Fraga
  0 siblings, 2 replies; 5+ messages in thread
From: Nick Dokos @ 2011-03-01 21:39 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: nicholas.dokos, Emacs Org mode mailing list

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [bug] error in html export: backend not defined
  2011-03-01 21:39 ` Nick Dokos
@ 2011-03-02  7:00   ` Eric S Fraga
  2011-03-02  8:27   ` [patch] fix backend error for html export (was Re: [O] [bug] error in html export: backend not defined) Eric S Fraga
  1 sibling, 0 replies; 5+ messages in thread
From: Eric S Fraga @ 2011-03-02  7:00 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Emacs Org mode mailing list

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

Yes, I think so.  Bastien?  

Just to confirm, removing the bibtex preprocessing did do the job for
me, but only because that particular org file had no citations...

thanks,
eric

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [patch] fix backend error for html export (was Re: [O] [bug] error in html export: backend not defined)
  2011-03-01 21:39 ` Nick Dokos
  2011-03-02  7:00   ` Eric S Fraga
@ 2011-03-02  8:27   ` Eric S Fraga
  2011-03-02 17:17     ` Bastien
  1 sibling, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2011-03-02  8:27 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Emacs Org mode mailing list

[-- 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [patch] fix backend error for html export (was Re: [O] [bug] error in html export: backend not defined)
  2011-03-02  8:27   ` [patch] fix backend error for html export (was Re: [O] [bug] error in html export: backend not defined) Eric S Fraga
@ 2011-03-02 17:17     ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2011-03-02 17:17 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: nicholas.dokos, Emacs Org mode mailing list

Hi Eric,

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> A patch that seems to fix the problem is attached.

Sorry I just pushed a fix before seeing your patch - also we need to add

  (defvar org-export-current-backend) 

in the file to keep the compiler happy.

Thanks for spotting this and for the patch!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-02 17:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [patch] fix backend error for html export (was Re: [O] [bug] error in html export: backend not defined) Eric S Fraga
2011-03-02 17:17     ` Bastien

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).