> I don't know if users will find this too annoying, maybe not, > but probably this is what should be done to solve such dilemma that > the same diff can be used in two ways: by applying the diff to the > buffers with 'C-c C-a', or by applying to the files with 'git apply'. > Without saving the buffers before running the command, either > will fail: 'C-c C-a' will fail on changes produced from files, > 'git apply' will fail on changes produced from unsaved buffers. Here is a new customizable option 'multi-file-diff-unsaved' that defines what to do with unsaved changes. When it is 'use-buffer' then it handles the case Eshel demonstrated where changes are applied over unsaved buffers. But when the value is 'save-buffers', then 'save-some-buffers' is called before producing the diff.