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 17:30:02 -0500 Message-ID: <4125.1331159402@alphaville> References: <87sjhlxako.fsf@live.com> <20423.1331134740@alphaville> <3555.1331150405@alphaville> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5PN5-0001qQ-O9 for emacs-orgmode@gnu.org; Wed, 07 Mar 2012 17:30:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5PMz-0000SU-QB for emacs-orgmode@gnu.org; Wed, 07 Mar 2012 17:30:11 -0500 Received: from g6t0185.atlanta.hp.com ([15.193.32.62]:38022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5PMz-0000OP-LJ for emacs-orgmode@gnu.org; Wed, 07 Mar 2012 17:30:05 -0500 In-Reply-To: Message from suvayu ali of "Wed\, 07 Mar 2012 22\:54\:57 +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, >=20 > On Wed, Mar 7, 2012 at 21:00, Nick Dokos wrote: > > 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. > > >=20 > This worked as you hypothesised. :) >=20 > > 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. >=20 > I am not sure how I can conclusively confirm that, but I think when I > export to latex, the exported latex buffer loads it. For example, I > don't see this issue when say I go through these steps: >=20 > 1. Open a tex file. > 2. Open and export an org file to latex. > 3. Open a new tex file. >=20 > In this case step (1) must be loading tex.el, circumventing the issue. >=20 Actually, your backtrace in the original post makes things clearer now. org-export-as-latex calls find-file-noselect on the .tex file, which calls after-find-file which runs the find-file-hook. Somehow the find-file-hook is set up[fn:1] as in VirTeX-common-initialization to call TeX-master-file - although your backtrace shows compiled code, it's pretty clear that that's the setting of the find-file-hook that VirTeX-common-initialization has done. So it looks as if tex.el is partially loaded: the initialization is done, the hook is set up but the defvar has failed, probably because of the let-bind. Nick Footnotes: [fn:1] =C3=A0 la Sidney Harris - cf. http://www.sciencecartoonsplus.com/in= dex.php