[ESS] loading ESS mode conditional on certain file names

Toby Dylan Hocking tdhock at OCF.Berkeley.EDU
Sat Apr 11 09:28:56 CEST 2009


These lines of code can be put in your ~/.emacs file and should help you 
out:

(add-to-list 'load-path "/path/to/ess-5.3.4/lisp")
(autoload 'R-mode "ess-site.el" "ESS" t)
(setq auto-mode-alist (cons '("\\.R$" . R-mode) auto-mode-alist))
(setq ess-eval-visibly-p nil)
(setq inferior-R-program-name "/path/to/R")

Of course you will need to change the file paths to the correct locations 
of ESS and R on your system.

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

On Fri, 10 Apr 2009, Adrian Dragulescu wrote:

>
> Hello,
>
> When I open a file in Emacs, it takes me about 10 seconds, and I would like 
> to speed up the process as much as possible.  I've indentified two possible 
> issues related to ESS.
>
> 1) I have (require 'ess-site) in my .emacs file.  Can I make it conditional 
> on the file extension?  I would like to run this require command only if file 
> I open has a .R or .r extension.  If I double-click on a txt file, I don't 
> need ESS.  I just want to open the file fast. Without the ess require 
> statement my start up is 2 seconds.
>
> 2) It seems that ESS is searching for R on my system.  From my *Messages* 
> buffer:
> Finding all versions of R on your system...
> Sorry, no version of R could be found on your system.
> I have a non-standard network installation of R.  How should I point ESS to 
> the right location, to save the searching time.
>
> I am using Emacs 22.3 & ESS 5.3.11 on Win XP.
>
> Thank you,
> Adrian
>
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>




More information about the ESS-help mailing list