Hello Nick., Nick Dokos writes: > suvayu ali wrote: > [snipped] > > 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. Thanks for the analysis. I think you are right. With my limited elisp skills I would say its a *bug* and coming from org. If I take that let-binding off and setting the TeX-master by checking with if it ever bound seems fixing this problem. this patch fixing the problem. (can be further improved)