So either you need to capture the output with every call (would have to see
how this overhead affects interactive evaluation), or you try to catch
updates to the device. There are no R-level hooks for the latter outside of
the RGraphicsDevice package, which would present performance issues, unless
this "future direction" was implemented:

We will also make it possible to dynamically modify the C routines that
implement an internal graphics device, e.g. the C routine that is called to
draw a line. While we have provided routines that call the corresponding R
function in the device, it is useful to be able to implement some of these
primitives with R functions and others with C routines and mix code across
the languages.

That would be a reasonably easy TODO to address, presumably relying on
getNativeSymbolInfo().

Michael



On Mon, Nov 18, 2013 at 6:19 PM, Vitalie Spinu <spinuvit@gmail.com> wrote:

>  >>> Yihui Xie on Mon, 18 Nov 2013 19:47:01 -0600 wrote:
>
>  > Are you trying to reinvent the evaluate package? :)
>  > http://cran.r-project.org/package=evaluate I think what you described
>  > are basically what we did in evaluate:
>  > https://github.com/hadley/evaluate/blob/master/R/eval.r
>
> I think it is a bit different. I don't want to capture the device each
> time an user send a command, but would like to catch the actual plotting
> event, and then save into a file and re-display in emacs.
>
> I admit I don't fully understand how evaluate works and how it might
> help with the problem. Evaluate seems to capture only the new.plot
> events which is not enough for what we need.
>
>
>    Vitalie
>

	[[alternative HTML version deleted]]

