Less hacky way to intercept plot output
Currently we overwrite R print methods to capture plot output and send it to servr. It would be nice to do this more cleanly with something like addTaskCallback(). I want to keep usage extremely simple, such that nothing is done differently than what you would do if you were operating locally. A potential issue with addTaskCallback() is that I don't think you can know that you need to intercept a plot output until after it has already been written to the default graphics device. Some deeper knowledge of R internals would be useful here...
Why would you need to intercept plot output before it is rendered? You should be able to just copy from whatever device is active to whatever device lets you capture the output.
Oh - now it is so obvious! Thanks! We can do that easily for lattice and ggplot, but how do you detect in the callback whether the previous top-level command was a base graphics? The "value" in the callback is NULL in this case.
For base graphics you will need to take the approach from the evaluate package, which unfortunately means comparing the display list after every task to the previous and if something has changed, push an update.