[ESS] back/forwardslash incompatability

Rodney Sparapani rsparapa at mcw.edu
Fri Jul 22 18:11:09 CEST 2005


>You need to use "\\"
> ("\" is an escape code on every OS, "\\" = \  (escaping the escape).
>
>best,
>-tony
>
>
>On 7/21/05, tim downie <timbodownie2004 at yahoo.co.uk> wrote:
>  
>
>>Hi,
>>
>>I've used R within ESS (on Xemacs) for several years
>>on Linux, and have now installed on windows NT.
>>
>>There seems to be a problem when sourcing a file
>>using C-c C-l in that emacs insists on using \ to
>>delimit directories, but the Rterm shell interprets
>>this as an escape eg. \test turns into [tab]est etc.
>>The error message is "cannot open file" as the wrong
>>filename is submitted.
>>
>>I've searched available documentation & help sites
>>but I can't seem to find any other mention of the
>>problem.
>>
>>Thanks
>>Tim
>>
>>    
>>
Actually, this was noisily discussed (on the ess-core mailing list,
I think).  I couldn't convince anybody else that it is an R bug :o)
Should be a simple work-around, although, I didn't commit it
since no one has tested it.  Try the following code and let us know:

(defun ess-load-file (filename)
"Alternate version of `ess-load-file', required with S+4.
This version sends the S-Plus command
     source(\"filename\")
to S.  This version does not guarantee to save .Last.value
This version does not offer alternate buffers or editing capability."
     (interactive (list
           (or
            (and (eq major-mode 'ess-mode)
             (buffer-file-name))
            (ess-replace-in-string (expand-file-name
             (read-file-name "Load S file: " nil nil t)) "[\\]" "/"))))
     (if (equal (ess-get-process-variable
         ess-current-process-name 'inferior-ess-ddeclient)
        (default-value 'inferior-ess-ddeclient))
     (ess-load-file-original filename)
       (ess-load-file-ddeclient filename))
     (widen))




More information about the ESS-help mailing list