[ESS] back/forwardslash incompatability

tim downie timbodownie2004 at yahoo.co.uk
Mon Jul 25 18:51:44 CEST 2005


--- Rodney Sparapani <rsparapa at mcw.edu> wrote:

> 
> >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))
> 
It does something, ... but no enough.
The backslashes are no longer being enterpreted as
escape codes, but the forwardslashes don't appear to
be instered.
The error mesage I get is 
cannot open file `C:workingcricketstrip_odi.r' 
the file name should be C:/working/cricket/strip_odi.r
I changed a couple of obvious tinkers, namely
change "load S file"  to "load R file", and 
changing "[\\]" to "[\]".

any further ideas?  
Thanks
Tim




More information about the ESS-help mailing list