[ESS] Emacs finding "R" on Windows {was "Release of ESS 5.3.5"}
Richard M. Heiberger
rmh at temple.edu
Fri Aug 24 19:06:20 CEST 2007
I need guidance on the fix.
The new statement
(getenv "ProgramFiles")
in the English locale returns
"C:\\Program Files"
which has an embedded blank and therefore doesn't work in many emacs commands.
That is why I had hard-wired the "c:/progra~1".
The embedded blank breaks all sorts of code, specifically in this
case ess-r-version-date
(ess-r-version-date "c:/Program Files/R/R-2.5.1/bin/Rterm.exe")
("-1" . "c:/Program Files/R/R-2.5.1/bin/Rterm.exe")
(getenv "ProgramFiles")
"C:\\Program Files"
(w32-short-file-name (getenv "ProgramFiles") )
"c:/PROGRA~1"
(ess-r-version-date (concat (getenv "ProgramFiles") "\\R/R-2.5.1/bin/Rterm.exe"))
("-1" . "C:\\Program Files\\R/R-2.5.1/bin/Rterm.exe")
(ess-r-version-date "c:/Progra~1/R/R-2.5.1/bin/Rterm.exe")
("2007-08-01" . "c:/Progra~1/R/R-2.5.1/bin/Rterm.exe")
(ess-r-version-date (w32-short-file-name "c:/Program Files/R/R-2.5.1/bin/Rterm.exe"))
("2007-08-01" . "c:/PROGRA~1/R/R-25~1.1/bin/Rterm.exe")
(ess-r-version-date (concat (w32-short-file-name (getenv "ProgramFiles")) "\\R/R-
2.5.1/bin/Rterm.exe"))
("2007-08-01" . "c:/PROGRA~1\\R/R-2.5.1/bin/Rterm.exe")
The fix is to introduce the w32-short-file-name function.
This works correctly in GNU emacs. I think from past discussion that it
doesn't work in Xemacs.
I would do it with the definition in ess-cust.el
(defcustom ess-ProgramFiles
"Safe (no embedded blanks) 8.3 name that works across internationalization."
(if ess-microsoft-p
(w32-short-file-name (getenv "ProgramFiles"))
nil))
one possible way to get around the missing function in xemacs is
(defcustom ess-ProgramFiles
"Safe (no embedded blanks) 8.3 name that works across internationalization."
(if ess-microsoft-p
(if (featurep 'xemacs)
(getenv "ProgramFiles")
(w32-short-file-name (getenv "ProgramFiles")))
nil))
this doesn't fix the xemacs problem. it is just keeps it from breaking.
More information about the ESS-help
mailing list