If I use Cx Cw (write-file) to write the current contents of the buffer to a new location, then after that my buffer will visit the new file instead of the original one. Sometimes I would like to save a copy of the buffer to a new location, but then continue editing at the original location .
I know that I can kill the existing file name from the history of the minibuffer (write-file) , and then immediately return the Cx Cf (find-file) prompt to visit the original file again, and this is the workaround that I am currently using. However, it feels inelegant.
I wondered if the (write-file) could accept some kind of prefix argument so as not to visit the buffer, but this only affects the confirmation of the rewriting.
So: is there an easier way to save the contents of the buffer in a file without changing the file I visit?
file-io emacs
Paul whittaker
source share