When a file changes on disk while you're editing in Emacs, how to merge both sets of changes into the file?
As you're familiar with
ediff you can also:
Start ediff between current buffer and its file on disk. This command can be used instead of `revert-buffer'. If there is nothing to revert then this command fails.
I have both this and a custom
diff-buffer-with-file variant bound to keys, as I use them quite frequently.
Currently I manually resolve the conflict as follows:
write-filethe buffer visiting the original file to a temporary file
ediff-merge-filesthe original file and the temporary file
- When finished, quit Ediff and confirm when it asks whether to kill buffer A and B.
write-filebuffer B (
*ediff-merge*) to the original file