Here is a patch that gets with-output-as-gadget working better. It seems to work correctly but using updating-output has revealed some problems that I don't yet know how to fix (still working on it).
The biggest problem with updating-output is that redisplay causes a new gadget-output-record to be created, but the gadget is not adopted by any sheet. The first gadget created remains as the adopted one but each redisplay causes the new, unadopted gadget to be "current". This shows up when erase-output-record is used and sheet-disown-child complains that the supplied gadget is not a child of sheet. Wrapping the with-output-as-gadget form as in (updating-output (stream :cache-value t) (with-output-as-gadget (stream) ...)) is a workaround.
That workaround won't work in accepting-values though because invoke-updating-output fails with a no-applicable-method error on the stream ;-(
The more minor problem (but still vexing) is that somehow updating-output ignores the stream-cursor-position adjustment that is supposed to move the cursor to after the gadget. The adjustment works fine without updating-output.
I think the patch is safe to commit. Maybe someone has some ideas about solving the updating-output problems?
Paul