Though is this really the right interface? Is it useful to return a
mode-line-format template from this, given that it can't be used in
the mode-line or header-line since the buttons won't work? Should
this just return a string that can be inserted into a buffer?
Something like (untested),