copy-to-buffer replace a buffer with the content of the region