GNU bug report logs - #24326
25.1; Daemon doesn't exit on Windows if kill-emacs-hook asks a question

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Sun, 28 Aug 2016 19:11:01 UTC

Severity: normal

Found in version 25.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 24326 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 24326 <at> debbugs.gnu.org
Subject: Re: bug#24326: 25.1;
 Daemon doesn't exit on Windows if kill-emacs-hook asks a question
Date: Mon, 29 Aug 2016 17:38:11 +0300
> Date: Sun, 28 Aug 2016 22:09:51 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> Not sure how to solve this.  One possibility would be to disable the
> "Save desktop?" question in this case, on MS-Windows only, and instead
> act as if the answer is NO.  desktop-kill is called from several
> places, so if we go this way, we will have to devise a way of figuring
> out that the question cannot be answered.

Actually, here's a simple solution:

diff --git a/lisp/server.el b/lisp/server.el
index 5300984..d34546d 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -648,7 +648,7 @@ server-start
 	  (add-hook 'delete-frame-functions 'server-handle-delete-frame)
 	  (add-hook 'kill-emacs-query-functions
                     'server-kill-emacs-query-function)
-	  (add-hook 'kill-emacs-hook 'server-force-stop) ;Cleanup upon exit.
+	  (add-hook 'kill-emacs-hook 'server-force-stop t) ;Cleanup upon exit.
 	  (setq server-process
 		(apply #'make-network-process
 		       :name server-name

I wonder if it ever makes sense for server.el to have its
kill-emacs-hook before any others.  server-force-stop deletes all the
client frames, so if there are no other frames, our capabilities to
communicate with the user are thereafter seriously degraded.

If the above is deemed too bold, we could do that only in the daemon,
using daemonp for the test.

Comments?




This bug report was last modified 8 years and 314 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.