2
votes

I admit I'm a total emacs and org-mode newbie. It worked great for me, but suddenly I'm having the following problem.

Say I open a file test.org with emacs

$ emacs test.org

The file contains:

* one
* two
** a
** b

When I try to export with C-x C-e I get the following error message:

Debugger entered--Lisp error: (void-variable b)
  eval(b nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)

I just found out about org-mode and was immediately ecstatic about it. Within minutes I could refactor my plain text notes for org-mode, including math formulas and export them to latex and from there pdf. I used C-x C-e o as explained here: http://orgmode.org/manual/LaTeX_002fPDF-export-commands.html

This worked great on both the GNU Emacs 23.3.1 that I have on my Mac OS X Terminal as well as with the newest Emacs release 24.1 which I had installed as a standalone .app

Unfortunately this didn't last very long and I got the error message described above, even for the most simple org files. What strikes me, that both installations of emacs started having this problem at the same time. I even deleted my, slightly modified, .emacs file in the home directory but that didn't help either.

It seems like emacs always fails wie evaluating the last line. If I delete it

* one
* two
** a

The error message is:

Debugger entered--Lisp error: (void-variable a)
  eval(a)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)

Any help is very much appreciated! I very much like org-mode and would love to learn el. However, at the moment I don't even know how to write more than two lines of LISP. Googling for this error message leaded to descriptions of problems that seemed to be totally unrelated.

2

2 Answers

5
votes

Use C-c C-e h (you indicate you are pressing C-x C-e) to export to HTML and C-c C-e p to export to PDF. If you are using a menu bar, take a look under the "Org" menu, item "Export/Publish...(C-c C-e)"

(C-x C-e evaluates an elisp expression...those error messages are complaining about evaluation of **a and **b as elisp expressions...)

1
votes

You can also use M-x and invoke the output method for the buffer using the interactive function name that matches the style you want, e.g.

M-x org-export-as-html
M-x org-export-as-pdf
M-x org-export-as-latex

etc. Use tab to auto-complete the names. You may find this method simpler to remember while still learning your way around org-mode.