emacs_chrome icon indicating copy to clipboard operation
emacs_chrome copied to clipboard

"Active processes exist; kill them and exit anyway? (yes or no)" even when no clients

Open aspiers opened this issue 13 years ago • 9 comments

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.

aspiers avatar Sep 12 '12 14:09 aspiers

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?

stsquad avatar Sep 12 '12 14:09 stsquad

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.

aspiers avatar Sep 12 '12 21:09 aspiers

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.

stsquad avatar Sep 18 '12 15:09 stsquad

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?

aspiers avatar Sep 18 '12 15:09 aspiers

It looks like that would be the place to hook into. Patches are of course welcome ;-)

stsquad avatar Sep 18 '12 16:09 stsquad

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 :(

aspiers avatar Sep 20 '12 23:09 aspiers

Just reproduced it on another machine and I'm pretty sure the fix works.

aspiers avatar Sep 21 '12 13:09 aspiers

Why not set-process-query-on-exit-flag? http://www.gnu.org/software/emacs/manual/html_node/elisp/Query-Before-Exit.html

tkf avatar Dec 11 '12 21:12 tkf

Great idea thanks! That sounds like a much better way of doing it. I didn't know that was possible ...

aspiers avatar Dec 12 '12 01:12 aspiers