[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] orgmode and auctex
From: |
Carsten Dominik |
Subject: |
Re: [O] orgmode and auctex |
Date: |
Sat, 11 Feb 2012 18:40:05 +0100 |
On 9.2.2012, at 21:08, Nick Dokos wrote:
> Thomas Alexander Gerds <address@hidden> wrote:
>
>>
>> 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:".
>>
>
> 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 tried
> it again yet.
I think this prompt comes from the function `reftex-TeX-master-file'. The
user is prompted when TeX-master is an existing variable (i.e. AUCTeX
is loaded), and when its value is nil or `shared'.
Greetings
- Carsten
>
> Nick
>
>
>> so maybe, if you do not want to get prompted, you could try setting
>> (setq-default TeX-master t).
>>
>> Cheers
>> Tomy
>>
>>
>>
>> Christopher Witte <address@hidden> 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 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 <address@hidden> wrote:
>>>
>>>> Christopher Witte <address@hidden> 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
>>>>
>> --
>> Thomas A. Gerds -- Assoc. Prof. Department of Biostatistics
>> University of Copenhagen, Ă˜ster Farimagsgade 5, 1014 Copenhagen, Denmark
>> Office: CSS-15.2.07 (Gamle Kommunehospital)
>> tel: 35327914 (sec: 35327901)
>>
>
- [O] orgmode and auctex, Christopher Witte, 2012/02/07
- Re: [O] orgmode and auctex, Nick Dokos, 2012/02/07
- Re: [O] orgmode and auctex, Christopher Witte, 2012/02/09
- Re: [O] orgmode and auctex,
Carsten Dominik <=
- Re: [O] orgmode and auctex, Nick Dokos, 2012/02/11
- Re: [O] orgmode and auctex, Christopher Witte, 2012/02/20
- Re: [O] orgmode and auctex, Nick Dokos, 2012/02/24
- Re: [O] orgmode and auctex, Christopher Witte, 2012/02/24