with-output-to-string

with-output-to-string is a Lisp macro in `subr.el'.

(with-output-to-string &rest BODY)

Execute BODY, return the text it sent to `standard-output', as a string.