"Active processes exist; kill them and exit anyway? (yes or no)" even when no clients
If I quit an emacs via C-x C-c which has the edit server running, then I always get Active processes exist; kill them and exit anyway? (yes or no) even when there are no active clients of the server. It is annoying to have to type yes each time in this case.
That's odd. You shouldn't be quitting an existing emacs when you abort and edit session. Are you editing in an existing frame or do you have a new frame created each time you edit a text area?
What does C-h k C-x C-c say when you are in a edit buffer?
Firstly thanks for the quick reply :) Sorry, I think I misled you somehow. I'm talking about quitting emacs (not emacsclient) when there is no edit session / client, e.g. if I just started emacs and then immediately pressed C-x C-c. The edit server process is automatically started from my .emacs, but then it prevents emacs from quitting cleanly because the process is still running at exit.
I'm not sure what the correct fix for this is. Certainly I get the same problem with erc processes running which cause Emacs to prompt to make sure I'm sure.
Couldn't we use the kill-emacs-query-functions hook to check whether the edit server has any clients, and if not, kill the server process?
It looks like that would be the place to hook into. Patches are of course welcome ;-)
Looks like there are no suitable hooks and advice will be needed instead.
I hacked up https://github.com/aspiers/emacs_chrome/commit/19b5a0e722fc4c573658c4733939088354e1ee58 however for some weird reason I can no longer reproduce the bug in order to test the fix :(
Just reproduced it on another machine and I'm pretty sure the fix works.
Why not set-process-query-on-exit-flag? http://www.gnu.org/software/emacs/manual/html_node/elisp/Query-Before-Exit.html
Great idea thanks! That sounds like a much better way of doing it. I didn't know that was possible ...