The recommendations on this page are pertinent - using advice is not ideal. But in this situation I don't think there is an alternative short of patching the emacs C source code.
Sorry I haven't merged your request yet, RL has intervened. I'll comment further once I've read up on the Advice advice you linked to.
No problem - I've just realised I was doing it wrong anyway. I'll force-push an updated version shortly (github should automatically update this pull request).
@aspiers did you ever push your update? This pull request doesn't seem to have changed.
Add some advice before save-buffers-kill-emacs to avoid unnecessary p…
…rompt on exit
Also disable the same advice on server stop, to avoid
advice redefinition warnings on server restart.
Sorry - I forgot to push. I'm still not convinced this new version is 100% right, but it's better than the old one at least, and probably better than nothing too ;-)
I'll merge this for now so it can get wider testing. I reserve the right to revert it before the next release if people report weirdness!