From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: orgmode and auctex Date: Sat, 11 Feb 2012 12:33:43 -0500 Message-ID: <14373.1328981623@alphaville> References: <10922.1328638512@alphaville> <4354.1328818115@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 ([140.186.70.92]:38373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwGpe-0001TD-KX for emacs-orgmode@gnu.org; Sat, 11 Feb 2012 12:34:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RwGpX-0001St-M9 for emacs-orgmode@gnu.org; Sat, 11 Feb 2012 12:33:54 -0500 Received: from g1t0026.austin.hp.com ([15.216.28.33]:45184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwGpX-0001ST-Af for emacs-orgmode@gnu.org; Sat, 11 Feb 2012 12:33:47 -0500 In-Reply-To: Message from Christopher Witte of "Sat\, 11 Feb 2012 18\:21\:32 +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: Christopher Witte Cc: Thomas Alexander Gerds , nicholas.dokos@hp.com, Org Mode Christopher Witte wrote: > Yes, I get this response when I open a .org file. I only want it when I o= pen a .tex file. >=20 > Cheers, > Chris >=20 I just reproduced it (no idea why I wasn't able to reproduce it earlier). S= tay tuned. Nick > On 9 February 2012 21:08, Nick Dokos wrote: >=20 > Thomas Alexander Gerds wrote: >=20=20=20=20 > > > > Hi Chris, > > > > maybe I cannot follow exactly what you are trying to do, but when I > > start emacs -q and evaluate (setq-default TeX-master nil) and then = open > > a new file test.tex, then I get the same prompt "Master file:". > > >=20=20=20=20 > I think Chris means that he gets the prompt when he opens a .org file. > I couldn't reproduce that behavior when I tried it but I have not tri= ed > it again yet. >=20=20=20=20 > Nick >=20 > > so maybe, if you do not want to get prompted, you could try setting > > (setq-default TeX-master t). > > > > Cheers > > Tomy > > > > > > > > Christopher Witte writes: > > > > > OK so using the setq-default inside a hook is probably not a good > > > idea. > > > But I can reliably reproduce this problem, I'm surprised you coul= dn't. > > > If > > > I start emacs using emacs -Q and open an org file everything is f= ine. > > > If I > > > then evaluate this > > > > > > (setq-default TeX-master nil) > > > > > > (defun org-mode-reftex-setup () > > > =C2=A0 (load-library "reftex") > > > =C2=A0 (and (buffer-file-name) > > > =C2=A0 =C2=A0 =C2=A0 =C2=A0(file-exists-p (buffer-file-name)) > > > =C2=A0 =C2=A0 =C2=A0 =C2=A0(reftex-parse-all)) > > > =C2=A0 (define-key org-mode-map (kbd "C-c )") 'reftex-citation)) > > > (add-hook 'org-mode-hook 'org-mode-reftex-setup) > > > > > > and try to open an org file I get prompted "Master file: ~/". =C2= =A0I'm > > > running > > > Ubuntu 11.10 and the emacs-snapshot package: GNU Emacs 23.3.1 > > > (i686-pc-linux-gnu, GTK+ Version 2.24.5), latest org pulled from = git > > > today. > > > Is there any more information I could provide to help diagnose th= is > > > problem? > > > > > > Cheers > > > Chris. > > > > > > On 7 February 2012 19:15, Nick Dokos wrot= e: > > > > > >> Christopher Witte wrote: > > >> > > >> > I've had a small problem with orgmode and auctex. =C2=A0Follwi= ng the > > > auctex > > >> quickstart I added the > > >> > following to my .emacs > > >> > > > >> > (setq-default TeX-master nil) > > >> > > > >> > and then from the orgmode FAQ to setup reftex in orgmode I add= ed > > > the > > >> following > > >> > > > >> > (defun org-mode-reftex-setup () > > >> > =C2=A0 (load-library "reftex") > > >> > =C2=A0 (and (buffer-file-name) > > >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0(file-exists-p (buffer-file-name)) > > >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0(reftex-parse-all)) > > >> > =C2=A0 (define-key org-mode-map (kbd "C-c )") 'reftex-citation= )) > > >> > (add-hook 'org-mode-hook 'org-mode-reftex-setup) > > >> > > > >> > With both of these, whenever I opened an org file I was asked = to > > > name > > >> the master file. =C2=A0If I comment > > >> > out the setq-default I don't get the behaviour I would like wi= th > > >> mulitfile tex files. =C2=A0My solution > > >> > was to change > > >> > > > >> > (setq-default TeX-master nil) > > >> > > > >> > to > > >> > > > >> > (add-hook 'TeX-mode-hook (lambda () > > >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq-d= efault TeX-master nil))) > > >> > > > >> > I then appear to get the behaviour I desire. =C2=A0Is this a g= ood way > > > to do > > >> this? =C2=A0If so I might add it > > >> > to the FAQ. > > >> > > > >> > > >> Probably not. setq-default sets the default value of the variable > > >> whereas the hook is supposed to set the local value in order to > > > override > > >> the default value: setting the default value from a hook seems > > > backwards > > >> to me. > > >> > > >> Actually, I added the above code (*without* the TeX-mode-hook mo= d) > > > to my > > >> minimal .emacs and opening org files does not generate any > > > questions. Are > > >> you sure you have diagnosed the problem correctly? > > >> > > >> Nick > > >> > > -- > > Thomas A. Gerds -- Assoc. Prof. Department of Biostatistics > > University of Copenhagen, =C3=98ster Farimagsgade 5, 1014 Copenhage= n, Denmark > > Office: CSS-15.2.07 (Gamle Kommunehospital) > > tel: 35327914 (sec: 35327901) > > >=20 >=20 > ---------------------------------------------------- > Alternatives: >=20 > ----------------------------------------------------