[ESS] Manually turn on ess script mode

Tyler Smith tyler.smith at eku.edu
Sun Mar 6 20:25:00 CET 2011


On 03/06/2011 01:11 PM, Cesar Rabak wrote:
> Em 6/3/2011 13:17, Tyler Smith escreveu:
>   >  Hi,
>   >
>   >  I'm marking a bunch of student R assignments. Some of the students have
>   >  submitted files without the .R extension, so ess doesn't know to turn on
>   >  when I open them. I can resave them with the correct extension and
>   >  reopen them. However, I could skip this step if there was a way to
>   >  explicitly tell emacs to start ess[s] mode. Is this possible? The manual
>   >  only says that the mode should start automatically, but doesn't indicate
>   >  if it's possible to make it start when the hooks don't get triggered.
>   >
>   >  Thanks,
>   >
> Tyler,
>
> Ask your students to have at the first line of their files:
> # -*- R -*-
>
> This will switch emacs to R-mode.
>
Of course, as will asking them to save the file with a .R extension. The 
main issue here is that there is a useful feature of ESS that is not 
documented in a way that is clear to me: calling R-mode. This is the 
simplest solution to my problem, uses an existing feature of ESS, and 
only became an issue because it wasn't documented in a straightforward way.

Tyler



More information about the ESS-help mailing list