If you use `with-temp-buffer` here instead we don't have to do all the juggling with the buffer in the var.