The way build_annotations() makes `format-annotate-function' use the same temp buffer " *Format Temp 0*" on each call is not reentrant. If TO-FN from the format-alist does anything that writes another buffer with a buffer-file-format then the buffer which TO-FN is supposed to be working on is clobbered. foo.el below illustrates the problem. Evaluating it writes a /tmp/x containing THIS IS FORMAT ONE this is buffer yyy text where I expected it to be THIS IS FORMAT TWO hello world The `message's emitted by my-one-encode and my-two-encode show they get the same " *Format Temp 0*" buffer. The latter is what you get in /tmp/x if taking away the "/tmp/y" blob within `my-two-encode'. I expect this wouldn't arise often in practice, but it ought to be reasonably easy to make build_annotations() (or wherever) do better in the management of temporary buffers. I expect it's a matter of finding the right place in the write crunching that temp buffers used can be killed.