[R] Setting up Xemacs + Sweave

Tamas Papp tpapp at axelero.hu
Wed Apr 23 19:44:00 CEST 2003


Dear list,

I have tried to setup my Xemacs for use with Sweave, which I indend to learn.
I have followed the instructions in the Sweave FAQ, that is to say, I put

(defun Rnw-mode ()
  (require 'ess-noweb)
  (noweb-mode)
  (if (fboundp 'R-mode)
      (setq noweb-default-code-mode 'R-mode)))
(add-to-list 'auto-mode-alist '("\\.Rnw\\'" . Rnw-mode))
(add-to-list 'auto-mode-alist '("\\.Snw\\'" . Rnw-mode))

(setq reftex-file-extensions
      '(("Snw" "Rnw" "nw" "tex" ".tex" ".ltx") ("bib" ".bib")))
(setq TeX-file-extensions
      '("Snw" "Rnw" "nw" "tex" "sty" "cls" "ltx" "texi" "texinfo"))

in my init.el. However, if I open an Rnw file
(/usr/lib/R/library/tools/Sweave/Sweave-test-1.Rnw) it is not treated
as one, only if I evaluate (Rnw-mode) using M-: on the buffer. My
auto-mode-alist looks like this:

(("\\.Snw\\'" . Rnw-mode) ("\\.Rnw\\'" . Rnw-mode) ("\\.lout\\'"
. lout-mode) ("\\.tex\\'" . latex-mode) ("\\.tex$" . yatex-mode)
... ) (I have left the end off)

so it should be working correctly. One strange thing: immediately
after I open the Rnw file, Xemacs gives the following warning:

(1) (local-variables/warning) File local-variables error: Symbol's
function definition is void: noweb-font-lock-mode

I don't know whether this is relevant. I am using debian/testing, the
package versions are:

ii  xemacs21                  21.4.6-8
ii  xemacs21-basesupport      2003.01.27-1.1
ii  xemacs21-bin              21.4.6-8
ii  xemacs21-gnome-nomule     21.4.6-8
ii  xemacs21-support          21.4.6-8
ii  ess                       5.1.24-3
ii  r-base                    1.7.0-0.cran.1
ii  r-base-core               1.6.0.rel-1
ii  r-recommended             1.4.1-1

Regards,

Tamas Papp

-- 
Tamás K. Papp
E-mail: tpapp at axelero.hu (preferred, especially for large messages)
        tpapp at westel900.net
Please try to send only (latin-2) plain text, not HTML or other garbage.



More information about the R-help mailing list