From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Schmidt Subject: Re: TeX-master: TeX-master is let-bound Date: Fri, 25 Jan 2013 11:36:02 +0000 (GMT) Message-ID: <878v7hze8k@ch.ristopher.com> References: <87a9vajy4n@ch.ristopher.com> <20121025214510.GB24961@kuru.dyndns-at-home.com> <87sj92chzi@ch.ristopher.com> <20121026065115.GC24961@kuru.dyndns-at-home.com> <87mwz98vz4@ch.ristopher.com> <87ham6s7rf@ch.ristopher.com> <871ud9zgpn.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyhZs-0001SS-L3 for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 06:36:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TyhZl-0001Ws-Ob for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 06:36:12 -0500 Received: from ristopher.com ([146.185.21.93]:35638 helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyhZl-0001WK-8y for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 06:36:05 -0500 In-Reply-To: <871ud9zgpn.fsf@bzg.ath.cx> (Bastien's message of "Fri, 25 Jan 2013 11:42:44 +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: emacs-orgmode@gnu.org Bastien writes: Hi Bastien, thanks for your reply. > Christopher Schmidt writes: >> Christopher Schmidt writes: >>> The default value it t anyway. The docstring suggests that this >>> variable should be set via file variables. I do not think org-mode >>> should worry about AUCTeX. >> >> Ping? >> >> The default value of TeX-master is t. Binding a symbol which might >> be defvar'ed within the let-body does not work. In fact, this might >> break the Emacs instance, rendering any latex-mode buffer unusable. > > Can you provide a reproducible recipe? I already did, check <87390w51k0@ch.ristopher.com>. The issue I described will only occur if one uses AUCTeX and AUCTeX has not been loaded already. Nick did not follow the recipe so he was not able to reproduce. >> To make a long story short, there is no excuse for the form in >> question. Please remove it. Everyone who messes with TeX-master >> should use org-export-latex-final-hook to set TeX-master and/or add a >> local variables list to the buffer. > > I skimmed the previous discussions, and my understanding is that the > patch will break things for some users, even those who don't mess with > TeX-master. It does not break anything for those who do not customise TeX-master. Those poor souls who do customise TeX-master can easily get back to The Right Thing using org-export-latex-final-hook. TeX-master is not meant to be customised by default anyway! TeX-master is a variable defined in `tex.el'. Its value is t Automatically becomes buffer-local when set. This variable is safe as a file local variable if its value satisfies the predicate `(lambda (x) (or (stringp x) (member x (quote (t nil shared dwim)))))'. Documentation: *The master file associated with the current buffer. If the file being edited is actually included from another file, you can tell AUCTeX the name of the master file by setting this variable. If there are multiple levels of nesting, specify the top level file. [...] It is suggested that you use the File Variables (see the info node in ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the Emacs manual) to set this variable permanently for each file. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Is it so? If yes, can we make a better patch? I do not think so. I do not see what's breaking here. The users gets what he wanna get. We could come up with some magic that preloads latex-mode (I proposed that in <87r4ods7fw@ch.ristopher.com>) and sets TeX-master buffer locally iff latex-mode actually defines this var. Yet, this is not how things should be. Org cannot, and should not, mess with other packages. Customising TeX-master is the bug, and it is on the users side. Bastien, thank you so much for looking into this issue. It has been bothering for quite some time. Greetings, Christopher