From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Witte Subject: Re: orgmode and auctex Date: Thu, 9 Feb 2012 17:42:20 +0100 Message-ID: References: <10922.1328638512@alphaville> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff2518e1d240104b88ab2c4 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvX4l-0003VP-Tb for emacs-orgmode@gnu.org; Thu, 09 Feb 2012 11:42:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvX4h-00075l-7P for emacs-orgmode@gnu.org; Thu, 09 Feb 2012 11:42:27 -0500 Received: from mail-pz0-f41.google.com ([209.85.210.41]:52816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvX4g-00075I-Lq for emacs-orgmode@gnu.org; Thu, 09 Feb 2012 11:42:23 -0500 Received: by dadv6 with SMTP id v6so1690271dad.0 for ; Thu, 09 Feb 2012 08:42:20 -0800 (PST) In-Reply-To: <10922.1328638512@alphaville> 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: nicholas.dokos@hp.com Cc: Org Mode --e89a8ff2518e1d240104b88ab2c4 Content-Type: text/plain; charset=ISO-8859-1 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 couldn't. If I start emacs using emacs -Q and open an org file everything is fine. If I then evaluate this (setq-default TeX-master nil) (defun org-mode-reftex-setup () (load-library "reftex") (and (buffer-file-name) (file-exists-p (buffer-file-name)) (reftex-parse-all)) (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: ~/". I'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 this problem? Cheers Chris. On 7 February 2012 19:15, Nick Dokos wrote: > Christopher Witte wrote: > > > I've had a small problem with orgmode and auctex. Follwing 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 added the > following > > > > (defun org-mode-reftex-setup () > > (load-library "reftex") > > (and (buffer-file-name) > > (file-exists-p (buffer-file-name)) > > (reftex-parse-all)) > > (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. If I comment > > out the setq-default I don't get the behaviour I would like with > mulitfile tex files. My solution > > was to change > > > > (setq-default TeX-master nil) > > > > to > > > > (add-hook 'TeX-mode-hook (lambda () > > (setq-default TeX-master nil))) > > > > I then appear to get the behaviour I desire. Is this a good way to do > this? If 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 mod) to my > minimal .emacs and opening org files does not generate any questions. Are > you sure you have diagnosed the problem correctly? > > Nick > --e89a8ff2518e1d240104b88ab2c4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable OK so using the setq-default inside a hook is probably not a good idea.=A0 = But I can reliably reproduce this problem, I'm surprised you couldn'= ;t.=A0 If I start emacs using emacs -Q and open an org file everything is f= ine.=A0 If I then evaluate this

(setq-default TeX-master nil)

(defun org-mode-reftex-setup ()=A0 (load-library "reftex")
=A0 (and (buffer-file-name)
= =A0=A0=A0=A0=A0=A0 (file-exists-p (buffer-file-name))
=A0=A0=A0=A0=A0=A0= (reftex-parse-all))
=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: ~/".=A0 I'm run= ning 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 this problem= ?

Cheers
Chris.

On 7 February 2= 012 19:15, Nick Dokos <nicholas.dokos@hp.com> wrote:
Probably not. setq-default sets the default value of the variab= le
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 mod) to my minimal .emacs and opening org files does not generate any questions. Are you sure you have diagnosed the problem correctly?

Nick

--e89a8ff2518e1d240104b88ab2c4--