This generic function formats the group and its elements and inserts the result into the current buffer, which is a temporary buffer. The contents of that buffer are later inserted into the popup buffer.
Functions that are called by this function may need to operate in
the buffer from which the transient was called. To do so they can
temporally make the
transient--source-buffer the current buffer.