[ESS] Automatic jump to error line in the source code.

Christophe Rhodes csr21 at cantab.net
Tue Aug 31 12:31:45 CEST 2010


Stephen Eglen <S.J.Eglen at damtp.cam.ac.uk> writes:

> but could someone (sometime) enumerate what the advantages of
> socket-oriented approach would be?  Is there a 'killer' feature that
> will convince us to investigate further?

Well, one aspect of a protocol (whether socket-based or in-process) --
as opposed to comint-like parsing of program output -- is that it's no
longer vulnerable to minor changes in textual output from the "inferior"
process (in Emacs terms).

For example, I saw somewhere (I think in the r-devel discussions about
storing srcrefs) that the printing of frame source locations in the
browser was accompanied by at least the fear that some R interfaces
might break as a result -- simply because of a change in textual output.
With the debugger information (frames, restarts and the like) computed
in R and then communicated to Emacs for display, there is no
compatibility constraint on R's printed output.

As another example, this communication protocol allows for direct
references from Emacs to R objects, as opposed to their printed
representation.  One way of exploiting this is to associate the printed
output in the Emacs REPL with a reference to the associated R object,
and allowing the user to click on them to effectively insert them
directly into the text stream that will be parse()d and eval()ed.  It's
a bit hard to describe; even a static screenshot doesn't really help,
but here's one anyway:
<http://www.doc.gold.ac.uk/~mas01cr/tmp/r-presentations.png>.  In that
screenshot, everything that is red is mouseable; a middle click
conceptually copies a reference to the forthcoming R input.  The lines
in bold are my input to R; the embedded bold red are input that has come
from middle clicking on other presentations.  It's perhaps not very
impressive with numbers and strings, but it works for other objects too
(data frames, time series -- anything, in principle).

I don't want to get all evangelistic about this -- I'm painfully aware
that at least at the moment I'm a newcomer to this community.  Stop me
if I become a distraction.

Cheers,

Christophe



More information about the ESS-help mailing list