On Feb 14, 2011, at 6:47 PM, Marinos K wrote: > I' ll try to study the source code of M-! so I can get an idea You might also try the "streams" information in the Elisp info node. It sounds as if what you want is to rebind the output stream, which I believe can be done with a "let" surrounding the command.