Say I'm editing a file
I'd like to be able to issue a command
M-x switch-to-bar-file that copies current contents of
~/mydirectory/foo.txt to a file
~/mydirectory/foo-bar.txt and drops me into a new buffer where I can edit
When I'm done editing
~/mydirectory/foo-bar.txt, I'd like to issue a command
M-x unswitch-from-bar-file which copies the current contents of
~/mydirectory/foo-bar.txt back over to
~/mydirectory/foo.txt and drops me back into the buffer where I can edit
It seems that there may be a way to do this with indirect buffers, but I can't quite figure out how to solve my problem.
Is this sort of thing possible?
I can post an example if that would help.