On Wed, Nov 10, 2010 at 10:47 AM, Hannu Kahra <hka...@gmail.com> wrote:

> (setq inferior-R-program-name "G:/r-2.12.0/bin/i386/rterm.exe")
>
> since R is installed on the G drive. Everything works if R is on G, but when
> changing the computer, R is usually on another drive and Emacs cannot find
> it. Is it possible to handle this case?

There's some discussion on the portable apps list about fixing up
emacs and getting the drive letter:

 http://portableapps.com/node/12042

Using:

(defvar usb-drive-letter (substring data-directory 0 3))

to get the drive letter from emacs' data-directory variable. You could
then paste this onto the start of the path to R.

I don't have a windows box with emacs on to muck with the relevant
lisp at the moment, but I reckon something like:

(defvar usb-drive-letter (substring data-directory 0 3))
(setq  inferior-R-program-name (concat usb-drive-letter
"r-2.12.0/bin/i386/rterm.exe"))

 might work. I think the substring gets the whole "X:/" part of the string.

Barry

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to