> I would like to take this: > > .img(plot(1:10), filename="a") > > and produce > > plot(1:10) > Peter Dalgaard provided me with this: f <- function(e) { if (!is.recursive(e)) e else if (e[[1]] == quote(.img)) e[[2]] else as.call(lapply(e, f)) } > f(quote({a<-1;.img(abc,123)})) { a <- 1 abc } which is exactly what I was looking for. Thanks Peter! Hadley