Sorry to be contrary, but are you sure this is fixed in the case when
download of ESSR.rda fails?    I’ve upgraded to what I believe is the
latest development version of ESS (svn checkout
<https://svn.r-project.org/ESS/trunk>
https://svn.r-project.org/ESS/trunk) and I still see this problem with
ess-remote.

The code in ess-rutils.ell and ess-utils.el has clearly been updated, but
it still encounters what looks like a buffer overflow when sending files to
a remote R, even one that is running under a local shell.  In the 'remote'
R process I see a bunch of garbage inserted that looks like various lines
were truncated (see the start of this thread for an example).

I instrumented ‘ess—inject-code-from-file’ to print the name of the file it
is injecting, and this is what I see after running ess-remote:

Failed to download ESSR.rda. Injecting ESSR code from local machine
injecting /Users/foo/.emacs.d/ESS/etc/ESSR/R/.basic.R
injecting /Users/foo/.emacs.d/ESS/etc/ESSR/R/.load.R
injecting /Users/foo/.emacs.d/ESS/etc/ESSR/R/completion.R
injecting /Users/foo/.emacs.d/ESS/etc/ESSR/R/debug.R
injecting /Users/foo/.emacs.d/ESS/etc/ESSR/R/developer.R
injecting /Users/foo/.emacs.d/ESS/etc/ESSR/R/misc.R
Warning: Bug in inferior-ess-mode: it forgets to call `run-mode-hooks'

That looks fine, the problem is trash in the R process.   Putting a
(sit-for 1) into ‘ess—inject-code-from-file’ after injecting each file
seems to help.   There is still the bug of inferior-ess-mode not calling
run-mode-hooks, but at least ess-remote works for me now.

BTW, I tried using Tramp, but it just hangs for me when starting a remote R
session in aquamacs on Mavericks. I’m hopeful that debugging ess-remote
will be easier than debugging tramp. Besides which I don’t need a
generalized solution to remote files and processes in emacs, I just need a
specific solution for R that works when R is running on a remote machine.

-- 

Aquamacs 2.5 based on GNU Emacs 23.4.1





On Fri, Nov 22, 2013 at 12:08 AM, Vitalie Spinu <spinuvit@gmail.com> wrote:


>
> Yes, this was solved in dev for quite time already, but we are delaying
> the patch release as there are some unsolved issues still hanging
> around.
>
> Either upgrade to dev version or use tramp for time being as documented:
>
>
> http://ess.r-project.org/Manual/ess.html#ESS-processes-on-Remote-Computers
>
>
>  Vitalie
>
>  >>> chris warth on Fri, 22 Nov 2013 00:00:30 -0800 wrote:
>
>  > Has anyone else noticed buggy behavior in ess-remote?
>  > Running ess-13.09, when using 'M-x ess-remote' to bind to an
> established R
>  > session, ess-utils.el:ess--inject-code-from-file() tries to inject the
> file
>  > etc/ESSR.R into the session.    This results in numerous errors in the R
>  > session as shown below.
>  > The simplest way to recreated this is
>
>  >         M-x shell
>  >         <start R in the shell buffer>
>  >         M-x ess-remote
>
>  > 'ess-remote' may be undefined if you haven't loaded a file whose name
> ends
>  > in '.R' yet; use require('ess-utils') first if that happens.
>
>  > bash-3.2$ R
>
>  > R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
>  > [...shortened for previty...]
>
>  > Type 'q()' to quit R.
>
>  >> options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient',
>  > show.error.locations=TRUE)
>  >> + Error: object 'cur_log' not found
>  >> Error: unexpected '}' in "             }"
>  >> Error: unexpected '}' in "         }"
>  >> Error: object '.essWEnames' not found
>  >> Error in assign(log_name, c(log, list(cur_log)), envir = .GlobalEnv) :
>  >   object 'log_name' not found
>  >> > Error: unexpected '}' in "     }"
>  >> > + + > Error: unexpected '}' in " }"
>  >> > >
>  >>
>  >>
>  >>
>  >> # try using ess-remote again
>  >> options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient',
>  > show.error.locations=TRUE)
>  >> Error in get(log_name, envir = .GlobalEnv, inherits = FALSE) :
>  >   object 'log_name' not found
>  >> > > > + + Error: unexpected symbol in:
>  > "             capture.output( {
>  >                                                                ev
>  >                                                     ev"
>  >>
>  >>
>  >> # try using ess-remote another time
>  >> options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient',
>  > show.error.locations=TRUE)
>  >> >
>
>  >      [[alternative HTML version deleted]]
>
>  > ______________________________________________
>  > ESS-help@r-project.org mailing list
>  > https://stat.ethz.ch/mailman/listinfo/ess-help
>

	[[alternative HTML version deleted]]

