emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] AUCTeX conflicting with org-mode


From: Nick Dokos
Subject: Re: [O] AUCTeX conflicting with org-mode
Date: Wed, 07 Mar 2012 15:00:05 -0500

suvayu ali <address@hidden> wrote:

> Hi Nick,
> 
> On Wed, Mar 7, 2012 at 16:39, Nick Dokos <address@hidden> wrote:
> >> In org-latex.el Tex-master is set to t to suppress auctex from asking for
> >> that variable while exporting with org-latex..(IIRC there was a discussion 
> >> and
> >> Carsten made that change)
> >>
> >> Some how org leaving that to void at the end of org-latex export (I 
> >> coundn't
> >> figure out how?).
> >>
> >
> > That sounds far-fetched to me: once TeX-master is bound, one has to go
> > to some lengths to unbind it (see makunbound - but I'm pretty sure
> > that's not used anywhere in org code - there are a few instances of the
> > function analog, fmakunbound).
> >
> > It seems much more likely that in these cases, it never got bound in the
> > first place, possibly because of dependency problems in the loading of
> > packages. But I cannot reproduce the problem, so I'm speaking
> > theoretically only and my imagination may be failing me.
> 
> I think Yagnesh is talking about this thread:
> <http://thread.gmane.org/gmane.emacs.orgmode/48512/focus=48526>
> 
> I took a quick look at the commit (ca49e89) and the source (org-latex.el
> line 888), but everything looks good to me. To add more information,
> while exporting to latex I get the following warning when auctex site
> files are present.
> 
> Export buffer:
> Exporting to LaTeX...
> Warning: defvar ignored because TeX-master is let-bound
> Making TeX-master buffer-local while let-bound!
> 
> Hope this clearly explains the problem I am facing.
> 

Yup - that shows that tex.el has not been loaded by the time you try the
export, so the let-bind (Carsten's fix) happens first and then the
defvar (from tex.el) complains because that's usually not what you want:
you want to get to the global binding (which doesn't exist at that point
in time). That's what the doc for defvar warns about:

,----
| ...
| If SYMBOL has a local binding, then this form affects the local
| binding.  This is usually not what you want.  Thus, if you need to
| load a file defining variables, with this form or with `defconst' or
| `defcustom', you should always load that file _outside_ any bindings
| for these variables.  (`defconst' and `defcustom' behave similarly in
| this respect.)
`----


As a workaround-and-proof-of-concept, try

(load "tex")

before loading org. Assuming that that works, you will probably want
to arrange things that this is always done.

It might also be the case that Carsten's fix needs to be modified to
check whether TeX-master is bound already - then it can let-bind it
without problems; but I'm not sure what to do if that's not the case.

The question I have is what exactly causes tex.el to be loaded at that
point in time. If you can figure that out, then that might lead to a
more permanent solution.

> PS: BTW, why is AUCTeX not part of Emacs?
> 

I thought it had to do with the glacial release schedule of emacs 21/22/23:
at the time, auctex/preview-latex was undergoing changes at a much faster
pace, so waiting for emacs releases was just not feasible. Whether it
could be integrated now is a good question, but I don't have a good answer
for it. 

There is also a recent thread that implies that the copyrights were not
assigned to the FSF, but that seems to have changed. See

  http://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00847.html

Nick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]