Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable scratch buffer to execute R code in emacs-ess

Tags:

emacs

r

ess

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)
like image 459
sheed03 Avatar asked Feb 27 '23 04:02

sheed03


1 Answers

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.

like image 124
Leo Alekseyev Avatar answered Mar 02 '23 19:03

Leo Alekseyev