Instead of a temporary buffer, just call write-region with the string itself.
write-region always uses coding-system-for-write if set, so we don’t have to
set the other coding-related variables. However, we should bind the annotation
functions so that they don’t mess with the output.
Use write-region for appending text as well. This simplifies the code and
eliminates a race condition. While there, make the operation silent.
Instead of a temporary buffer, just call write-region with the string itself. write-region always uses coding-system-for-write if set, so we don’t have to set the other coding-related variables. However, we should bind the annotation functions so that they don’t mess with the output.
Use write-region for appending text as well. This simplifies the code and eliminates a race condition. While there, make the operation silent.