Christopher Schmidt <christop...@ch.ristopher.com> wrote: > Nick Dokos <nicholas.do...@hp.com> writes: > > Hi Nick, > > > Christopher Schmidt <christop...@ch.ristopher.com> wrote: > > > >> Nick Dokos <nicholas.do...@hp.com> writes: > >> > What missing variable definition? By the time the export is > >> > finished, the let-bind is gone. There is no definition of > >> > TeX-master anywhere, just as if you never had org loaded: why > >> > should auctex object to that? > >> > > >> > So I don't understand why it would break: all the common scenarios > >> > that I have tried work with no problem for me. I can load an org > >> > file, export to latex, open the latex file (which loads auctex) and > >> > do auctex things to it. I don't get any error. What exactly do I > >> > have to do in order to break it? > >> > >> In org-latex.el, within the binding: > >> > >> (if to-buffer > >> (unless (eq major-mode 'latex-mode) (latex-mode)) > >> (save-buffer)) > >> > > > > You mean that's where you get the error? > > No, this is where AUCTeX is loaded. > > >> Recipe: > >> > >> emacs -q # + AUCTeX > >> C-x b rms RET > >> M-x org-mode RET > >> M-: (insert "a") RET > >> C-x h > > Are you sure that (featurep 'tex) is nil at this point?
Yes. > > >> M-x org-export-region-as-latex RET > > ... if it is nil, (latex-mode) should load AUCTeX, which ultimately > breaks AUCTeX due to the ignored defvar. Not in my case: (latex-mode) loads the standard tex mode. How do you get auctex loaded? I thought it was a separate package that needs special initialization: (load "auctex.el" nil t t) is what the documentation says. And I have 11.86 which I believe is latest available, but I might be behind the times: I haven't worried about it in a few years. Nick