From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: AUCTeX conflicting with org-mode Date: Wed, 07 Mar 2012 15:00:05 -0500 Message-ID: <3555.1331150405@alphaville> References: <87sjhlxako.fsf@live.com> <20423.1331134740@alphaville> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5N27-0006Wa-Km for emacs-orgmode@gnu.org; Wed, 07 Mar 2012 15:00:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5N25-0003BI-3T for emacs-orgmode@gnu.org; Wed, 07 Mar 2012 15:00:23 -0500 Received: from g1t0028.austin.hp.com ([15.216.28.35]:18569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5N24-00038Q-SA for emacs-orgmode@gnu.org; Wed, 07 Mar 2012 15:00:21 -0500 In-Reply-To: Message from suvayu ali of "Wed, 07 Mar 2012 18:37:49 +0100." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: suvayu ali Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org, Yagnesh Raghava Yakkala suvayu ali wrote: > Hi Nick, > > On Wed, Mar 7, 2012 at 16:39, Nick Dokos 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: > > > 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