tags:

views:

138

answers:

1

Hello, I have switched to using emacs-ess for my R code development and it is working great. I would like to be able to write some small R code I am using for debugging my R script into the scratch buffer, and be able to execute the scratch buffer code in the R process buffer. I've found how I could change the scratch buffer's mode to text by putting the following in the .emacs file:

(setq initial-major-mode 'text-mode)

Is there a similar statement I can put in my .emacs file that would make the scratch buffer have the ess-mode? I tried the following which results in an error about wrong type argument:

(setq initial-major-mode 'ess-mode)
+2  A: 

What you want is (setq initial-major-mode 'R-mode). Alternatively, you could just do M-x R-mode when in the scratch buffer to change the major mode.

Leo Alekseyev
Thank you Leo, that is exactly what I was looking for!
sheed03