auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX] Re: ESS, AUCTeX, S/Rweave (noweb) and mode switching


From: Michael Hoffman
Subject: [AUCTeX] Re: ESS, AUCTeX, S/Rweave (noweb) and mode switching
Date: Sat, 08 Mar 2008 18:14:12 +0000
User-agent: Thunderbird 2.0.0.12 (Windows/20080213)

Brett Presnell wrote:

(Side question: shouldn't TeX-PDF-mode be picked up from the master
file?)

It would be nice.

The problem is that once I move into a code chunk in a .Rnw file
(automatically switching from AUCTeX to ESS mode) and then back out of
the code chunch (automatically switching back to AUCTeX mode),
TeX-master and TeX-PDF-mode both get set to nil.  Worse, this also
causes the invaluable reftex to lose all its reference information.

Typing C-cC-n (i.e., running TeX-normal-mode) causes all the
auctex/reftex information to be reset properly.  However, the Noweb
menu disappears when I do this and when I move back into a code chunk
the buffer remains in PDFLaTeX/M mode instead of ESS[S] mode.  Typing
C-cC-n again seems to toggle this behavior, but then TeX-master and
TeX-PDF-mode get set to nil again.  Obviously this whole process
becomes especially annoying when editing a complicated document.

FWIW, I can partially automate the call of TeX-normal-mode with

(add-hook 'noweb-select-doc-mode-hook (function (lambda ()
                        (TeX-normal-mode t))))

I recommend this instead as it will not deactivate the mark when changing modes:

  (add-hook 'noweb-select-doc-mode-hook
            '(lambda ()
               ; avoid infinite loops
               (unless (boundp 'in-noweb-select-doc-mode-hook)
                 (let* ((in-noweb-select-doc-mode-hook t)
                        ; don't deactivate the mark when changing modes
                        (deactivate-mark))
                   (TeX-normal-mode t)))))

I do not have any problem with the Noweb menu disappearing.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]