> > If `save-buffers-kill-emacs' were called after that, the Emacs daemon > would be killed, losing the edits to bar.txt. > Indeed, you are correct. Updated patch attached, which also takes care of running processes.